@@ -3,31 +3,31 @@ import { resolve } from 'path'
3
3
const jest = require ( 'jest' )
4
4
5
5
command (
6
- 'test [--watch] [--watchAll ]' ,
6
+ 'test [--watch] [--coverage ]' ,
7
7
'run unit-tests on your project' ,
8
8
args => {
9
9
return args
10
10
} ,
11
11
args => {
12
12
const watch = args . watch || false
13
- const watchAll = args . watchAll || false
14
- test ( watch , watchAll )
13
+ const coverage = args . coverage || false
14
+ test ( watch , coverage )
15
15
}
16
16
)
17
- . option ( 'watch ' , {
17
+ . option ( 'coverage ' , {
18
18
default : false ,
19
- description : 're-run tests when files change '
19
+ description : 'report on code coverage '
20
20
} )
21
- . option ( 'watchAll ' , {
21
+ . option ( 'watch ' , {
22
22
default : false ,
23
- description : 're-run tests when files change regardless of git diff '
23
+ description : 're-run tests when files change'
24
24
} )
25
25
26
- function test ( watch : boolean , watchAll : boolean ) {
26
+ function test ( watchAll : boolean , coverage : boolean ) {
27
27
jest . runCLI (
28
28
{
29
- watch,
30
29
watchAll,
30
+ coverage,
31
31
globals : JSON . stringify ( {
32
32
__TRANSFORM_HTML__ : true ,
33
33
'ts-jest' : {
@@ -54,6 +54,12 @@ function test(watch: boolean, watchAll: boolean) {
54
54
resolve (
55
55
'node_modules/fusing-angular-cli/.build/jest/HTMLCommentSerializer.js'
56
56
)
57
+ ] ,
58
+ testResultsProcessor : resolve ( 'node_modules/jest-junit-reporter' ) ,
59
+ collectCoverageFrom : [
60
+ 'src/**/*.{ts,html}' ,
61
+ '!src/browser/app.browser.entry.aot.ts' ,
62
+ '!src/browser/app.browser.entry.jit.ts'
57
63
]
58
64
} ,
59
65
[ resolve ( __dirname , '../../' ) ]
0 commit comments