Skip to content

Commit

Permalink
feat(builders): add bail and silent options to jest
Browse files Browse the repository at this point in the history
  • Loading branch information
skydever authored and FrozenPandaz committed Sep 14, 2018
1 parent f960d5a commit 817691d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/builders/src/jest/jest.builder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ describe('Jest Builder', () => {
ci: true,
updateSnapshot: true,
onlyChanged: true,
passWithNoTests: true
passWithNoTests: true,
bail: true,
silent: true
}
})
.toPromise();
Expand All @@ -84,7 +86,9 @@ describe('Jest Builder', () => {
ci: true,
updateSnapshot: true,
onlyChanged: true,
passWithNoTests: true
passWithNoTests: true,
bail: true,
silent: true
},
['./jest.config.js']
);
Expand Down
4 changes: 4 additions & 0 deletions packages/builders/src/jest/jest.builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ export interface JestBuilderOptions {
jestConfig: string;
tsConfig: string;
watch: boolean;
bail?: boolean;
ci?: boolean;
codeCoverage?: boolean;
onlyChanged?: boolean;
passWithNoTests?: boolean;
setupFile?: string;
silent?: boolean;
updateSnapshot?: boolean;
}

Expand All @@ -31,10 +33,12 @@ export default class JestBuilder implements Builder<JestBuilderOptions> {
const config: any = {
watch: options.watch,
coverage: options.codeCoverage,
bail: options.bail,
ci: options.ci,
updateSnapshot: options.updateSnapshot,
onlyChanged: options.onlyChanged,
passWithNoTests: options.passWithNoTests,
silent: options.silent,
globals: JSON.stringify({
'ts-jest': {
tsConfigFile: path.relative(builderConfig.root, options.tsConfig)
Expand Down
10 changes: 10 additions & 0 deletions packages/builders/src/jest/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@
"type": "boolean",
"description":
"Fail on missing snapshots. (https://jestjs.io/docs/en/cli#ci)"
},
"bail": {
"type": "boolean",
"description":
"Exit the test suite immediately upon the first failing test suite. (https://jestjs.io/docs/en/cli#bail)"
},
"silent": {
"type": "boolean",
"description":
"Prevent tests from printing messages through the console. (https://jestjs.io/docs/en/cli#silent)"
}
},
"required": ["jestConfig", "tsConfig"]
Expand Down

0 comments on commit 817691d

Please sign in to comment.