From efc761329a1c905ff14d23251dd801c0a842b32a Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Wed, 25 May 2022 15:13:46 +0800 Subject: [PATCH 01/15] feat: new rule scalar-property-missing-example --- packages/core/src/config/all.ts | 1 + .../common/scalar-property-missing-example.ts | 55 +++++++++++++++++++ packages/core/src/rules/oas2/index.ts | 2 + packages/core/src/rules/oas3/index.ts | 2 + packages/core/src/typings/openapi.ts | 3 +- 5 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 packages/core/src/rules/common/scalar-property-missing-example.ts diff --git a/packages/core/src/config/all.ts b/packages/core/src/config/all.ts index 4398758d82..7c0916ed07 100644 --- a/packages/core/src/config/all.ts +++ b/packages/core/src/config/all.ts @@ -42,6 +42,7 @@ export default { spec: 'error', 'no-invalid-schema-examples': 'error', 'no-invalid-parameter-examples': 'error', + 'scalar-property-missing-example': 'error', }, oas3_0Rules: { 'no-invalid-media-type-examples': 'error', diff --git a/packages/core/src/rules/common/scalar-property-missing-example.ts b/packages/core/src/rules/common/scalar-property-missing-example.ts new file mode 100644 index 0000000000..d2cc27bbdd --- /dev/null +++ b/packages/core/src/rules/common/scalar-property-missing-example.ts @@ -0,0 +1,55 @@ +import { Oas2Rule, Oas3Rule } from '../../visitors'; +import { Oas2Schema } from '../../typings/swagger'; +import { Oas3Schema, Oas3_1Schema } from '../../typings/openapi'; +import { UserContext } from '../../walk'; +import { OasVersion } from 'core/src/oas-types'; + +const SCALAR_TYPES = ['string', 'integer', 'number', 'boolean', 'null']; + +export const ScalarPropertyMissingExample: Oas3Rule | Oas2Rule = () => { + return { + SchemaProperties( + properties: { [name: string]: Oas2Schema | Oas3Schema | Oas3_1Schema }, + { report, location, oasVersion, resolve }: UserContext, + ) { + for (const propName of Object.keys(properties)) { + const propSchema = resolve(properties[propName]).node; + + if (!propSchema || !isScalarSchema(propSchema)) { + continue; + } + + if (!propSchema.example && !(propSchema as Oas3_1Schema).examples) { + report({ + message: `Scalar property should have "example"${ + oasVersion === OasVersion.Version3_1 ? ' or "examples"' : '' + } defined.`, + location: location.child(propName).key(), + }); + } + } + }, + }; +}; + +function isScalarSchema(schema: Oas2Schema | Oas3Schema | Oas3_1Schema) { + if (!schema.type) { + return false; + } + + if (schema.allOf || (schema as Oas3Schema).anyOf || (schema as Oas3Schema).oneOf) { + // Skip allOf/oneOf/anyOf as it's complicated to validate it right now. + // We need core support for checking contrstrains through those keywords. + return false; + } + + if (schema.format === 'binary') { + return false; + } + + if (Array.isArray(schema.type)) { + return schema.type.every((t) => SCALAR_TYPES.includes(t)); + } + + return SCALAR_TYPES.includes(schema.type); +} diff --git a/packages/core/src/rules/oas2/index.ts b/packages/core/src/rules/oas2/index.ts index 9a50d35ddb..e16d83dde7 100644 --- a/packages/core/src/rules/oas2/index.ts +++ b/packages/core/src/rules/oas2/index.ts @@ -39,6 +39,7 @@ import { ResponseMimeType } from './response-mime-type'; import { PathSegmentPlural } from '../common/path-segment-plural'; import { ResponseContainsHeader } from '../common/response-contains-header'; import { ResponseContainsProperty } from './response-contains-property'; +import { ScalarPropertyMissingExample } from '../common/scalar-property-missing-example'; export const rules = { spec: OasSpec as Oas2Rule, @@ -82,6 +83,7 @@ export const rules = { 'path-segment-plural': PathSegmentPlural as Oas2Rule, 'response-contains-header': ResponseContainsHeader as Oas2Rule, 'response-contains-property': ResponseContainsProperty as Oas2Rule, + 'scalar-property-missing-example': ScalarPropertyMissingExample, }; export const preprocessors = {}; diff --git a/packages/core/src/rules/oas3/index.ts b/packages/core/src/rules/oas3/index.ts index cccb2cd050..48026f1a7e 100644 --- a/packages/core/src/rules/oas3/index.ts +++ b/packages/core/src/rules/oas3/index.ts @@ -47,6 +47,7 @@ import { NoInvalidSchemaExamples } from '../common/no-invalid-schema-examples'; import { NoInvalidParameterExamples } from '../common/no-invalid-parameter-examples'; import { ResponseContainsHeader } from '../common/response-contains-header'; import { ResponseContainsProperty } from './response-contains-property'; +import { ScalarPropertyMissingExample } from '../common/scalar-property-missing-example'; export const rules = { spec: OasSpec, @@ -98,6 +99,7 @@ export const rules = { 'no-invalid-parameter-examples': NoInvalidParameterExamples, 'response-contains-header': ResponseContainsHeader, 'response-contains-property': ResponseContainsProperty, + 'scalar-property-missing-example': ScalarPropertyMissingExample, } as Oas3RuleSet; export const preprocessors = {}; diff --git a/packages/core/src/typings/openapi.ts b/packages/core/src/typings/openapi.ts index 1aec56db80..a00ce1160b 100644 --- a/packages/core/src/typings/openapi.ts +++ b/packages/core/src/typings/openapi.ts @@ -153,7 +153,8 @@ export interface Oas3Schema { 'x-tags'?: string[]; } -export interface Oas3_1Schema extends Oas3Schema { +export type Oas3_1Schema = Oas3Schema & { + type?: string | string[]; examples?: any[]; } From 9e999be408e6d4645a0c145bc73e6c40af06f224 Mon Sep 17 00:00:00 2001 From: Roman Sainchuk Date: Wed, 25 May 2022 11:21:09 +0300 Subject: [PATCH 02/15] fix: fail job if tests fail --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d6d45b371e..8a915d86fc 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -32,7 +32,7 @@ jobs: CI: true with: annotations: none - test-script: npx jest ./packages --silent --ci --json --testLocationInResults --outputFile=report.json --bail --coverage || exit 0 + test-script: npx jest ./packages --silent --ci --json --testLocationInResults --outputFile=report.json --bail --coverage - name: E2E Tests run: npm run e2e env: From c8986e2cc4f1f279bd4d3d73d9244e3e2989e05c Mon Sep 17 00:00:00 2001 From: Andrew Tatomyr Date: Wed, 25 May 2022 10:16:22 +0200 Subject: [PATCH 03/15] chore: make CI fail on failing tests --- .github/workflows/tests.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8a915d86fc..558f84e6e8 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -26,6 +26,10 @@ jobs: echo Using Node $(node -v), NPM $(npm -v) echo npm ci + - name: Typechek + run: npm run typecheck + - name: Unit Tests + run: npm run unit - name: Unit Tests & Coverage Report uses: artiomtr/jest-coverage-report-action@v2.0-rc.4 env: From f3e8156b1aa3f32a6807cd3c0df76210c5bcaf85 Mon Sep 17 00:00:00 2001 From: Roman Sainchuk Date: Wed, 25 May 2022 12:18:05 +0300 Subject: [PATCH 04/15] chore: test coverage --- .github/workflows/tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 558f84e6e8..6dee407dc4 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -29,8 +29,8 @@ jobs: - name: Typechek run: npm run typecheck - name: Unit Tests - run: npm run unit - - name: Unit Tests & Coverage Report + run: npx jest ./packages --silent --ci --json --testLocationInResults --outputFile=report.json --bail --coverage || exit 0 + - name: Coverage Report uses: artiomtr/jest-coverage-report-action@v2.0-rc.4 env: CI: true From 24bbdd1bdf2925e9ccb9d0e54b74af73dae9cb9e Mon Sep 17 00:00:00 2001 From: Roman Sainchuk Date: Wed, 25 May 2022 12:32:45 +0300 Subject: [PATCH 05/15] chore: add typecheck step --- .github/workflows/tests.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 6dee407dc4..4cdd4ea782 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -25,11 +25,14 @@ jobs: echo echo Using Node $(node -v), NPM $(npm -v) echo - npm ci - - name: Typechek + - name: Install dependencies + run: npm ci + env: + CI: true + - name: Typecheck run: npm run typecheck - name: Unit Tests - run: npx jest ./packages --silent --ci --json --testLocationInResults --outputFile=report.json --bail --coverage || exit 0 + run: npx jest ./packages --silent --ci --json --testLocationInResults --outputFile=report.json --bail --coverage - name: Coverage Report uses: artiomtr/jest-coverage-report-action@v2.0-rc.4 env: From daba96f89d9ca34b25d0a729916de3d087f034f0 Mon Sep 17 00:00:00 2001 From: Andrew Tatomyr Date: Wed, 25 May 2022 11:14:16 +0200 Subject: [PATCH 06/15] docs: add description to the scalar-property-missing-example rule --- docs/resources/built-in-rules.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/resources/built-in-rules.md b/docs/resources/built-in-rules.md index 1f145c6156..f958a3f2b0 100644 --- a/docs/resources/built-in-rules.md +++ b/docs/resources/built-in-rules.md @@ -365,6 +365,11 @@ response-contains-header: - title ``` + +### scalar-property-missing-example + +Verifies that every scalar property has an example(s) defined. + ## Recommended config There are three built-in configurations: From b23f224784e5398337559828393c89226b23b703 Mon Sep 17 00:00:00 2001 From: Roman Sainchuk Date: Wed, 25 May 2022 12:36:29 +0300 Subject: [PATCH 07/15] chore: redundand env variable --- .github/workflows/tests.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4cdd4ea782..24652ee3b1 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -35,8 +35,6 @@ jobs: run: npx jest ./packages --silent --ci --json --testLocationInResults --outputFile=report.json --bail --coverage - name: Coverage Report uses: artiomtr/jest-coverage-report-action@v2.0-rc.4 - env: - CI: true with: annotations: none test-script: npx jest ./packages --silent --ci --json --testLocationInResults --outputFile=report.json --bail --coverage From 27bd554cbbbca0d0cb6a546aa76c1202e70495ff Mon Sep 17 00:00:00 2001 From: Roman Sainchuk Date: Wed, 25 May 2022 12:47:49 +0300 Subject: [PATCH 08/15] chore: try without test script --- .github/workflows/tests.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 24652ee3b1..43c709248b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -31,13 +31,10 @@ jobs: CI: true - name: Typecheck run: npm run typecheck - - name: Unit Tests - run: npx jest ./packages --silent --ci --json --testLocationInResults --outputFile=report.json --bail --coverage - - name: Coverage Report + - name: Unit Tests & Coverage Report uses: artiomtr/jest-coverage-report-action@v2.0-rc.4 with: annotations: none - test-script: npx jest ./packages --silent --ci --json --testLocationInResults --outputFile=report.json --bail --coverage - name: E2E Tests run: npm run e2e env: From e781ed80cb4e0d33f2d26455c00cd68b5928a442 Mon Sep 17 00:00:00 2001 From: Roman Sainchuk Date: Wed, 25 May 2022 13:16:40 +0300 Subject: [PATCH 09/15] chore: revert try without test-script --- .github/workflows/tests.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 43c709248b..1402480ed2 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -31,10 +31,15 @@ jobs: CI: true - name: Typecheck run: npm run typecheck - - name: Unit Tests & Coverage Report + - name: Unit Tests + run: npx jest ./packages --silent --ci --json --testLocationInResults --outputFile=report.json --bail --coverage + - name: Coverage Report uses: artiomtr/jest-coverage-report-action@v2.0-rc.4 with: + skip-step: none + coverage-file: report.json annotations: none + test-script: npx jest ./packages --silent --ci --json --testLocationInResults --outputFile=report-base.json --bail --coverage - name: E2E Tests run: npm run e2e env: From 43281a80b1b84ee4be6fe84270364e8518090b91 Mon Sep 17 00:00:00 2001 From: Ivana Isadora Devcic <33730345+skadinna@users.noreply.github.com> Date: Wed, 25 May 2022 12:02:20 +0200 Subject: [PATCH 10/15] Update docs/resources/built-in-rules.md --- docs/resources/built-in-rules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/built-in-rules.md b/docs/resources/built-in-rules.md index f958a3f2b0..ed52bb8f27 100644 --- a/docs/resources/built-in-rules.md +++ b/docs/resources/built-in-rules.md @@ -368,7 +368,7 @@ response-contains-header: ### scalar-property-missing-example -Verifies that every scalar property has an example(s) defined. +Verifies that every scalar property has an example defined. ## Recommended config From 7c59f63ff728648115754ec1bc8870d41deaad17 Mon Sep 17 00:00:00 2001 From: Andrew Tatomyr Date: Wed, 25 May 2022 12:24:10 +0200 Subject: [PATCH 11/15] chore: write unit tests --- .../scalar-property-missing-example.test.ts | 207 ++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 packages/core/src/rules/common/__tests__/scalar-property-missing-example.test.ts diff --git a/packages/core/src/rules/common/__tests__/scalar-property-missing-example.test.ts b/packages/core/src/rules/common/__tests__/scalar-property-missing-example.test.ts new file mode 100644 index 0000000000..a64f4107fd --- /dev/null +++ b/packages/core/src/rules/common/__tests__/scalar-property-missing-example.test.ts @@ -0,0 +1,207 @@ +import { outdent } from 'outdent'; +import { lintDocument } from '../../../lint'; +import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils'; +import { BaseResolver } from '../../../resolve'; + +describe('Oas3 scalar-property-missing-example', () => { + it('should report on a scalar property missing example', async () => { + const document = parseYamlToDocument( + outdent` + openapi: 3.0.0 + components: + schemas: + User: + type: object + properties: + email: + description: User email address + type: string + format: email + `, + 'foobar.yaml', + ); + + const results = await lintDocument({ + externalRefResolver: new BaseResolver(), + document, + config: await makeConfig({ 'scalar-property-missing-example': 'error' }), + }); + + expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(` + Array [ + Object { + "location": Array [ + Object { + "pointer": "#/components/schemas/User/properties/email", + "reportOnKey": true, + "source": "foobar.yaml", + }, + ], + "message": "Scalar property should have \\"example\\" defined.", + "ruleId": "scalar-property-missing-example", + "severity": "error", + "suggest": Array [], + }, + ] + `); + }); +}); + +describe('Oas3.1 scalar-property-missing-example', () => { + it('should report on a scalar property missing example', async () => { + const document = parseYamlToDocument( + outdent` + openapi: 3.1.0 + components: + schemas: + User: + type: object + properties: + email: + description: User email address + type: string + format: email + `, + 'foobar.yaml', + ); + + const results = await lintDocument({ + externalRefResolver: new BaseResolver(), + document, + config: await makeConfig({ 'scalar-property-missing-example': 'error' }), + }); + + expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(` + Array [ + Object { + "location": Array [ + Object { + "pointer": "#/components/schemas/User/properties/email", + "reportOnKey": true, + "source": "foobar.yaml", + }, + ], + "message": "Scalar property should have \\"example\\" or \\"examples\\" defined.", + "ruleId": "scalar-property-missing-example", + "severity": "error", + "suggest": Array [], + }, + ] + `); + }); + + it('should not report on a scalar property with an example', async () => { + const document = parseYamlToDocument( + outdent` + openapi: 3.1.0 + components: + schemas: + User: + type: object + properties: + email: + description: User email address + type: string + format: email + example: john.smith@example.com + `, + 'foobar.yaml', + ); + + const results = await lintDocument({ + externalRefResolver: new BaseResolver(), + document, + config: await makeConfig({ 'scalar-property-missing-example': 'error' }), + }); + + expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`); + }); + + it('should not report on a scalar property with an examples', async () => { + const document = parseYamlToDocument( + outdent` + openapi: 3.1.0 + components: + schemas: + User: + type: object + properties: + email: + description: User email address + type: string + format: email + examples: + - john.smith@example.com + - other@example.com + `, + 'foobar.yaml', + ); + + const results = await lintDocument({ + externalRefResolver: new BaseResolver(), + document, + config: await makeConfig({ 'scalar-property-missing-example': 'error' }), + }); + + expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`); + }); + + it('should not report on a non-scalar property missing an example', async () => { + const document = parseYamlToDocument( + outdent` + openapi: 3.1.0 + components: + schemas: + Pet: + type: object + required: + - photoUrls + properties: + photoUrls: + description: The list of URL to a cute photos featuring pet + type: array + maxItems: 20 + xml: + name: photoUrl + wrapped: true + items: + type: string + format: url + `, + 'foobar.yaml', + ); + + const results = await lintDocument({ + externalRefResolver: new BaseResolver(), + document, + config: await makeConfig({ 'scalar-property-missing-example': 'error' }), + }); + + expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`); + }); + + it('should not report on a scalar property of binary format missing an example', async () => { + const document = parseYamlToDocument( + outdent` + openapi: 3.1.0 + components: + schemas: + User: + type: object + properties: + responses: + type: string + format: binary + `, + 'foobar.yaml', + ); + + const results = await lintDocument({ + externalRefResolver: new BaseResolver(), + document, + config: await makeConfig({ 'scalar-property-missing-example': 'error' }), + }); + + expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`); + }); +}); From 5d285f8eec2b41c5fc43dc59385d40ff6bfdae8f Mon Sep 17 00:00:00 2001 From: Andrew Tatomyr Date: Wed, 25 May 2022 15:42:47 +0200 Subject: [PATCH 12/15] chore: update imports --- .../rules/common/scalar-property-missing-example.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/core/src/rules/common/scalar-property-missing-example.ts b/packages/core/src/rules/common/scalar-property-missing-example.ts index d2cc27bbdd..03da824580 100644 --- a/packages/core/src/rules/common/scalar-property-missing-example.ts +++ b/packages/core/src/rules/common/scalar-property-missing-example.ts @@ -1,8 +1,8 @@ -import { Oas2Rule, Oas3Rule } from '../../visitors'; -import { Oas2Schema } from '../../typings/swagger'; -import { Oas3Schema, Oas3_1Schema } from '../../typings/openapi'; -import { UserContext } from '../../walk'; -import { OasVersion } from 'core/src/oas-types'; +import type { Oas2Rule, Oas3Rule } from '../../visitors'; +import type { UserContext } from '../../walk'; +import type { Oas2Schema } from '../../typings/swagger'; +import type { Oas3Schema, Oas3_1Schema } from '../../typings/openapi'; +import { OasVersion } from '../../oas-types'; const SCALAR_TYPES = ['string', 'integer', 'number', 'boolean', 'null']; From 6ed01e92530fa999c392cc0a276c1669c331c530 Mon Sep 17 00:00:00 2001 From: Roman Sainchuk Date: Wed, 25 May 2022 16:18:52 +0300 Subject: [PATCH 13/15] chore: use jest from installed deps --- .github/workflows/tests.yaml | 2 +- package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 1402480ed2..e3418688c3 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -32,7 +32,7 @@ jobs: - name: Typecheck run: npm run typecheck - name: Unit Tests - run: npx jest ./packages --silent --ci --json --testLocationInResults --outputFile=report.json --bail --coverage + run: npm run jest -- --silent --ci --json --testLocationInResults --outputFile=report.json --bail --coverage - name: Coverage Report uses: artiomtr/jest-coverage-report-action@v2.0-rc.4 with: diff --git a/package.json b/package.json index 8835552ff9..aa0fc89748 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "engineStrict": true, "scripts": { "test": "npm run typecheck && npm run unit", - "unit": "jest ./packages --coverage --coverageReporters lcov text-summary", + "jest": "jest ./packages", + "unit": "npm run jest -- --coverage --coverageReporters lcov text-summary", "coverage:cli": "jest --roots packages/cli/src --coverage", "coverage:core": "jest --roots packages/core/src --coverage", "typecheck": "tsc --noEmit --skipLibCheck", From 027a263a85fae34064e27a810149c43fe02e2022 Mon Sep 17 00:00:00 2001 From: Andrew Tatomyr Date: Wed, 25 May 2022 16:14:37 +0200 Subject: [PATCH 14/15] chore: revert CI changes --- .github/workflows/tests.yaml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e3418688c3..d6d45b371e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -25,21 +25,14 @@ jobs: echo echo Using Node $(node -v), NPM $(npm -v) echo - - name: Install dependencies - run: npm ci + npm ci + - name: Unit Tests & Coverage Report + uses: artiomtr/jest-coverage-report-action@v2.0-rc.4 env: CI: true - - name: Typecheck - run: npm run typecheck - - name: Unit Tests - run: npm run jest -- --silent --ci --json --testLocationInResults --outputFile=report.json --bail --coverage - - name: Coverage Report - uses: artiomtr/jest-coverage-report-action@v2.0-rc.4 with: - skip-step: none - coverage-file: report.json annotations: none - test-script: npx jest ./packages --silent --ci --json --testLocationInResults --outputFile=report-base.json --bail --coverage + test-script: npx jest ./packages --silent --ci --json --testLocationInResults --outputFile=report.json --bail --coverage || exit 0 - name: E2E Tests run: npm run e2e env: From 47c0cf67e0d045a9aecacdd0cb7fbf8f05f024f1 Mon Sep 17 00:00:00 2001 From: Andrew Tatomyr Date: Wed, 25 May 2022 16:22:07 +0200 Subject: [PATCH 15/15] chore: revert package.json --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index aa0fc89748..8835552ff9 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,7 @@ "engineStrict": true, "scripts": { "test": "npm run typecheck && npm run unit", - "jest": "jest ./packages", - "unit": "npm run jest -- --coverage --coverageReporters lcov text-summary", + "unit": "jest ./packages --coverage --coverageReporters lcov text-summary", "coverage:cli": "jest --roots packages/cli/src --coverage", "coverage:core": "jest --roots packages/core/src --coverage", "typecheck": "tsc --noEmit --skipLibCheck",