Skip to content

Commit 6f909b2

Browse files
FrozenPandazvsavkin
authored andcommittedAug 30, 2018
feat(builders): add --only-changed and --pass-with-no-tests to jest
1 parent 794075b commit 6f909b2

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed
 

‎packages/builders/src/jest/jest.builder.spec.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ describe('Jest Builder', () => {
6565
watch: false,
6666
codeCoverage: true,
6767
ci: true,
68-
updateSnapshot: true
68+
updateSnapshot: true,
69+
onlyChanged: true,
70+
passWithNoTests: true
6971
}
7072
})
7173
.toPromise();
@@ -80,7 +82,9 @@ describe('Jest Builder', () => {
8082
watch: false,
8183
coverage: true,
8284
ci: true,
83-
updateSnapshot: true
85+
updateSnapshot: true,
86+
onlyChanged: true,
87+
passWithNoTests: true
8488
},
8589
['./jest.config.js']
8690
);

‎packages/builders/src/jest/jest.builder.ts

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export interface JestBuilderOptions {
1717
watch: boolean;
1818
ci?: boolean;
1919
codeCoverage?: boolean;
20+
onlyChanged?: boolean;
21+
passWithNoTests?: boolean;
2022
setupFile?: string;
2123
updateSnapshot?: boolean;
2224
}
@@ -31,6 +33,8 @@ export default class JestBuilder implements Builder<JestBuilderOptions> {
3133
coverage: options.codeCoverage,
3234
ci: options.ci,
3335
updateSnapshot: options.updateSnapshot,
36+
onlyChanged: options.onlyChanged,
37+
passWithNoTests: options.passWithNoTests,
3438
globals: JSON.stringify({
3539
'ts-jest': {
3640
tsConfigFile: path.relative(builderConfig.root, options.tsConfig)

‎packages/builders/src/jest/schema.json

+11
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@
2323
"Run tests when files change. (https://jestjs.io/docs/en/cli#watch)",
2424
"default": false
2525
},
26+
"onlyChanged": {
27+
"type": "boolean",
28+
"alias": "o",
29+
"description":
30+
"Isolate tests affected by uncommitted changes. (https://jestjs.io/docs/en/cli#onlychanged)"
31+
},
32+
"passWithNoTests": {
33+
"type": "boolean",
34+
"description":
35+
"Allow test suite to pass when no test files are found. (https://jestjs.io/docs/en/cli#passwithnotests)"
36+
},
2637
"codeCoverage": {
2738
"type": "boolean",
2839
"description":

0 commit comments

Comments
 (0)
Please sign in to comment.