Skip to content

Commit

Permalink
feat(testing): add --detectOpenHandles to Jest CLI Options (#2969)
Browse files Browse the repository at this point in the history
  • Loading branch information
bene-starzengruber committed May 8, 2020
1 parent b569302 commit ac6f52a
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/angular/api-jest/builders/jest.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ Type: `string`

A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter

### detectOpenHandles

Type: `boolean`

Attempt to collect and print open handles preventing Jest from exiting cleanly (https://jestjs.io/docs/en/cli.html#--detectopenhandles)

### findRelatedTests

Type: `string`
Expand Down
6 changes: 6 additions & 0 deletions docs/react/api-jest/builders/jest.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ Type: `string`

A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter

### detectOpenHandles

Type: `boolean`

Attempt to collect and print open handles preventing Jest from exiting cleanly (https://jestjs.io/docs/en/cli.html#--detectopenhandles)

### findRelatedTests

Type: `string`
Expand Down
2 changes: 2 additions & 0 deletions packages/jest/src/builders/jest/jest.impl.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ describe('Jest Builder', () => {
bail: 1,
color: false,
ci: true,
detectOpenHandles: true,
json: true,
maxWorkers: 2,
onlyChanged: true,
Expand Down Expand Up @@ -218,6 +219,7 @@ describe('Jest Builder', () => {
bail: 1,
color: false,
ci: true,
detectOpenHandles: true,
json: true,
maxWorkers: 2,
onlyChanged: true,
Expand Down
1 change: 1 addition & 0 deletions packages/jest/src/builders/jest/jest.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ function run(
bail: options.bail,
ci: options.ci,
color: options.color,
detectOpenHandles: options.detectOpenHandles,
json: options.json,
maxWorkers: options.maxWorkers,
onlyChanged: options.onlyChanged,
Expand Down
1 change: 1 addition & 0 deletions packages/jest/src/builders/jest/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { JsonObject } from '@angular-devkit/core';
export interface JestBuilderOptions extends JsonObject {
codeCoverage?: boolean;
config?: string;
detectOpenHandles?: boolean;
jestConfig: string;
testFile?: string;
setupFile?: string;
Expand Down
4 changes: 4 additions & 0 deletions packages/jest/src/builders/jest/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"description": "Deletes the Jest cache directory and then exits without running tests. Will delete Jest's default cache directory. _Note: clearing the cache will reduce performance_.",
"type": "boolean"
},
"detectOpenHandles": {
"description": "Attempt to collect and print open handles preventing Jest from exiting cleanly (https://jestjs.io/docs/en/cli.html#--detectopenhandles)",
"type": "boolean"
},
"jestConfig": {
"description": "The path of the Jest configuration. (https://jestjs.io/docs/en/configuration)",
"type": "string"
Expand Down

0 comments on commit ac6f52a

Please sign in to comment.