From 7b27ba4daa5185dac63e52f726f75f8b5bf5ec7a Mon Sep 17 00:00:00 2001 From: Adam L Barrett Date: Fri, 19 Jun 2020 14:20:24 -0600 Subject: [PATCH] fix(testing): allow jest --bail flag type to be either boolean or number (#3181) --- docs/angular/api-jest/builders/jest.md | 2 +- docs/react/api-jest/builders/jest.md | 2 +- packages/jest/src/builders/jest/schema.d.ts | 2 +- packages/jest/src/builders/jest/schema.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/angular/api-jest/builders/jest.md b/docs/angular/api-jest/builders/jest.md index dca2a5f131..dbeb23a6ae 100644 --- a/docs/angular/api-jest/builders/jest.md +++ b/docs/angular/api-jest/builders/jest.md @@ -10,7 +10,7 @@ Builder properties can be configured in angular.json when defining the builder, Alias(es): b -Type: `number` +Type: `number | boolean` Exit the test suite immediately after `n` number of failing tests. (https://jestjs.io/docs/en/cli#bail) diff --git a/docs/react/api-jest/builders/jest.md b/docs/react/api-jest/builders/jest.md index 094dbe5860..e39cf35215 100644 --- a/docs/react/api-jest/builders/jest.md +++ b/docs/react/api-jest/builders/jest.md @@ -11,7 +11,7 @@ Read more about how to use builders and the CLI here: https://nx.dev/react/guide Alias(es): b -Type: `number` +Type: `number | boolean` Exit the test suite immediately after `n` number of failing tests. (https://jestjs.io/docs/en/cli#bail) diff --git a/packages/jest/src/builders/jest/schema.d.ts b/packages/jest/src/builders/jest/schema.d.ts index 9fea456c2f..2c5e020ce3 100644 --- a/packages/jest/src/builders/jest/schema.d.ts +++ b/packages/jest/src/builders/jest/schema.d.ts @@ -8,7 +8,7 @@ export interface JestBuilderOptions extends JsonObject { testFile?: string; setupFile?: string; tsConfig: string; - bail?: number; + bail?: boolean | number; ci?: boolean; color?: boolean; clearCache?: boolean; diff --git a/packages/jest/src/builders/jest/schema.json b/packages/jest/src/builders/jest/schema.json index 3120b14938..b981100c8c 100644 --- a/packages/jest/src/builders/jest/schema.json +++ b/packages/jest/src/builders/jest/schema.json @@ -39,7 +39,7 @@ "bail": { "alias": "b", "description": "Exit the test suite immediately after `n` number of failing tests. (https://jestjs.io/docs/en/cli#bail)", - "type": "number" + "oneOf": [{ "type": "number" }, { "type": "boolean" }] }, "ci": { "description": "Whether to run Jest in continuous integration (CI) mode. This option is on by default in most popular CI environments. It will prevent snapshots from being written unless explicitly requested. (https://jestjs.io/docs/en/cli#ci)",