@@ -13,7 +13,8 @@ import {stream as wiredep} from 'wiredep';
1313import nodemon from 'nodemon' ;
1414import { Server as KarmaServer } from 'karma' ;
1515import runSequence from 'run-sequence' ;
16- import { protractor , webdriver_update } from 'gulp-protractor' ; < % if ( filters . stylus ) { % >
16+ import { protractor , webdriver_update } from 'gulp-protractor' ;
17+ import { Instrumenter } from 'isparta' ; < % if ( filters . stylus ) { % >
1718import nib from 'nib' ; < % } % >
1819
1920var plugins = gulpLoadPlugins ( ) ;
@@ -158,16 +159,18 @@ let mocha = lazypipe()
158159 } ) ;
159160
160161let istanbul = lazypipe ( )
161- . pipe ( plugins . babelIstanbul . writeReports )
162- . pipe ( plugins . babelIstanbul . enforceThresholds , {
162+ . pipe ( plugins . istanbul . writeReports )
163+ . pipe ( plugins . istanbulEnforcer , {
163164 thresholds : {
164165 global : {
165166 lines : 80 ,
166167 statements : 80 ,
167168 branches : 80 ,
168169 functions : 80
169170 }
170- }
171+ } ,
172+ coverageDirectory : './coverage' ,
173+ rootDirectory : ''
171174 } ) ;
172175
173176/********************
@@ -417,7 +420,7 @@ gulp.task('test:server', cb => {
417420 'env:test' ,
418421 'mocha:unit' ,
419422 'mocha:integration' ,
420- // 'mocha:coverage',
423+ 'mocha:coverage' ,
421424 cb ) ;
422425} );
423426
@@ -600,9 +603,12 @@ gulp.task('copy:server', () => {
600603gulp . task ( 'coverage:pre' , ( ) => {
601604 return gulp . src ( paths . server . scripts )
602605 // Covering files
603- . pipe ( plugins . babelIstanbul ( ) )
606+ . pipe ( plugins . istanbul ( {
607+ instrumenter : Instrumenter , // Use the isparta instrumenter (code coverage for ES6)
608+ includeUntested : true
609+ } ) )
604610 // Force `require` to return covered files
605- . pipe ( plugins . babelIstanbul . hookRequire ( ) ) ;
611+ . pipe ( plugins . istanbul . hookRequire ( ) ) ;
606612} ) ;
607613
608614gulp . task ( 'coverage:unit' , ( ) => {
0 commit comments