@@ -3,31 +3,31 @@ import { resolve } from 'path'
33const jest = require ( 'jest' )
44
55command (
6- 'test [--watch] [--watchAll ]' ,
6+ 'test [--watch] [--coverage ]' ,
77 'run unit-tests on your project' ,
88 args => {
99 return args
1010 } ,
1111 args => {
1212 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 )
1515 }
1616)
17- . option ( 'watch ' , {
17+ . option ( 'coverage ' , {
1818 default : false ,
19- description : 're-run tests when files change '
19+ description : 'report on code coverage '
2020 } )
21- . option ( 'watchAll ' , {
21+ . option ( 'watch ' , {
2222 default : false ,
23- description : 're-run tests when files change regardless of git diff '
23+ description : 're-run tests when files change'
2424 } )
2525
26- function test ( watch : boolean , watchAll : boolean ) {
26+ function test ( watchAll : boolean , coverage : boolean ) {
2727 jest . runCLI (
2828 {
29- watch,
3029 watchAll,
30+ coverage,
3131 globals : JSON . stringify ( {
3232 __TRANSFORM_HTML__ : true ,
3333 'ts-jest' : {
@@ -54,6 +54,12 @@ function test(watch: boolean, watchAll: boolean) {
5454 resolve (
5555 'node_modules/fusing-angular-cli/.build/jest/HTMLCommentSerializer.js'
5656 )
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'
5763 ]
5864 } ,
5965 [ resolve ( __dirname , '../../' ) ]
0 commit comments