11'use strict' ;
2+ /* eslint node:true */
23
34var gulp = require ( 'gulp' ) ;
45var config = require ( 'ng-factory' ) . use ( gulp , {
@@ -43,7 +44,7 @@ gulp.task('jshint', function() {
4344 . pipe ( jshint . reporter ( stylish ) ) ;
4445} ) ;
4546
46- var karma = require ( 'karma' ) . server ;
47+ var Server = require ( 'karma' ) . Server ;
4748var testTimezone = '' ;
4849gulp . task ( 'karma:unit' , gulp . series ( 'ng:test/templates' , function ( ) {
4950 // if testTimezone has value, set the environment timezone
@@ -53,18 +54,18 @@ gulp.task('karma:unit', gulp.series('ng:test/templates', function() {
5354 console . log ( 'Setting timezone to => [' + testTimezone + ']' ) ;
5455 process . env . TZ = testTimezone ;
5556 }
56- karma . start ( {
57+ new Server ( {
5758 configFile : path . join ( __dirname , 'test/karma.conf.js' ) ,
5859 browsers : [ 'PhantomJS' ] ,
5960 reporters : [ 'dots' ] ,
6061 singleRun : true
6162 } , function ( code ) {
6263 gutil . log ( 'Karma has exited with ' + code ) ;
6364 process . exit ( code ) ;
64- } ) ;
65+ } ) . start ( ) ;
6566} ) ) ;
6667gulp . task ( 'karma:server' , gulp . series ( 'ng:test/templates' , function karmaServer ( ) {
67- karma . start ( {
68+ new Server ( {
6869 configFile : path . join ( __dirname , 'test/karma.conf.js' ) ,
6970 browsers : [ 'PhantomJS' ] ,
7071 reporters : [ 'progress' ] ,
@@ -73,38 +74,38 @@ gulp.task('karma:server', gulp.series('ng:test/templates', function karmaServer(
7374 } , function ( code ) {
7475 gutil . log ( 'Karma has exited with ' + code ) ;
7576 process . exit ( code ) ;
76- } ) ;
77+ } ) . start ( ) ;
7778} ) ) ;
7879// codeclimate-test-reporter
7980gulp . task ( 'karma:travis' , gulp . series ( 'ng:test/templates' , function karmaTravis ( ) {
80- karma . start ( {
81+ new Server ( {
8182 configFile : path . join ( __dirname , 'test/karma.conf.js' ) ,
8283 browsers : [ 'PhantomJS' ] ,
8384 reporters : [ 'dots' , 'coverage' ] ,
8485 singleRun : true
8586 } , function ( code ) {
8687 gutil . log ( 'Karma has exited with ' + code ) ;
8788 process . exit ( code ) ;
88- // gulp.src('test/coverage/**/lcov.info')
89- // .pipe(coveralls())
90- // .on('end', function() {
91- // process.exit(code);
92- // });
93- } ) ;
89+ gulp . src ( 'test/coverage/**/lcov.info' )
90+ . pipe ( coveralls ( ) )
91+ . on ( 'end' , function ( ) {
92+ process . exit ( code ) ;
93+ } ) ;
94+ } ) . start ( ) ;
9495} ) ) ;
9596gulp . task ( 'karma:travis~1.2.0' , gulp . series ( 'ng:test/templates' , function karmaTravis120 ( ) {
96- karma . start ( {
97+ new Server ( {
9798 configFile : path . join ( __dirname , 'test/~1.2.0/karma.conf.js' ) ,
9899 browsers : [ 'PhantomJS' ] ,
99100 reporters : [ 'dots' ] ,
100101 singleRun : true
101102 } , function ( code ) {
102103 gutil . log ( 'Karma has exited with ' + code ) ;
103104 process . exit ( code ) ;
104- } ) ;
105+ } ) . start ( ) ;
105106} ) ) ;
106107gulp . task ( 'karma:travis~1.3.0' , gulp . series ( 'ng:test/templates' , function karmaTravis130 ( ) {
107- karma . start ( {
108+ new Server ( {
108109 configFile : path . join ( __dirname , 'test/~1.3.0/karma.conf.js' ) ,
109110 browsers : [ 'PhantomJS' ] ,
110111 reporters : [ 'dots' ] ,
@@ -114,7 +115,7 @@ gulp.task('karma:travis~1.3.0', gulp.series('ng:test/templates', function karmaT
114115 } , function ( code ) {
115116 gutil . log ( 'Karma has exited with ' + code ) ;
116117 process . exit ( code ) ;
117- } ) ;
118+ } ) . start ( ) ;
118119} ) ) ;
119120
120121gulp . task ( 'test' , gulp . series ( 'ng:test/templates' , gulp . parallel ( 'jshint' , 'karma:unit' ) ) ) ;
0 commit comments