feat(builders): add bail and silent options to jest

This commit is contained in:
Thomas Skalnik 2018-09-13 13:59:14 +02:00 committed by Jason Jean
parent f960d5aba2
commit 817691d38d
3 changed files with 20 additions and 2 deletions

View File

@ -67,7 +67,9 @@ describe('Jest Builder', () => {
ci: true,
updateSnapshot: true,
onlyChanged: true,
passWithNoTests: true
passWithNoTests: true,
bail: true,
silent: true
}
})
.toPromise();
@ -84,7 +86,9 @@ describe('Jest Builder', () => {
ci: true,
updateSnapshot: true,
onlyChanged: true,
passWithNoTests: true
passWithNoTests: true,
bail: true,
silent: true
},
['./jest.config.js']
);

View File

@ -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;
}
@ -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)

View File

@ -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"]