X Tutup
Skip to content

Commit 758efba

Browse files
committed
fix(gulp): use the new karma.Server api
Closes #4375
1 parent e21bf12 commit 758efba

File tree

1 file changed

+43
-15
lines changed

1 file changed

+43
-15
lines changed

gulpfile.js

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -610,21 +610,21 @@ gulp.task('test.unit.js', ['build.js.dev'], function (done) {
610610
gulp.task('test.unit.js.sauce', ['build.js.dev'], function (done) {
611611
var browserConf = getBrowsersFromCLI();
612612
if (browserConf.isSauce) {
613-
karma.server.start({
613+
new karma.Server({
614614
configFile: __dirname + '/karma-js.conf.js',
615615
singleRun: true,
616616
browserNoActivityTimeout: 240000,
617617
captureTimeout: 120000,
618618
reporters: ['dots'],
619619
browsers: browserConf.browsersToRun},
620-
function(err) {done(); process.exit(err ? 1 : 0);});
620+
function(err) {done(); process.exit(err ? 1 : 0);}).start();
621621
} else {
622622
throw new Error('ERROR: no Saucelabs browsers provided, add them with the --browsers option');
623623
}
624624
});
625625

626626
gulp.task('!test.unit.js/karma-server', function() {
627-
karma.server.start({configFile: __dirname + '/karma-js.conf.js', reporters: 'dots'});
627+
new karma.Server({configFile: __dirname + '/karma-js.conf.js', reporters: 'dots'}).start();
628628
});
629629

630630

@@ -647,7 +647,11 @@ gulp.task('test.unit.router', function (done) {
647647
});
648648

649649
gulp.task('!test.unit.router/karma-server', function() {
650-
karma.server.start({configFile: __dirname + '/modules/angular1_router/karma-router.conf.js'});
650+
new karma.Server({
651+
configFile: __dirname + '/modules/angular1_router/karma-router.conf.js',
652+
reporters: 'dots'
653+
}
654+
).start();
651655
});
652656

653657

@@ -697,33 +701,57 @@ gulp.task('!test.unit.dart/karma-run', function (done) {
697701

698702

699703
gulp.task('!test.unit.dart/karma-server', function() {
700-
karma.server.start({configFile: __dirname + '/karma-dart.conf.js', reporters: 'dots'});
704+
new karma.Server({configFile: __dirname + '/karma-dart.conf.js', reporters: 'dots'}).start();
701705
});
702706

703707

704708
gulp.task('test.unit.router/ci', function (done) {
705709
var browserConf = getBrowsersFromCLI();
706-
karma.server.start({configFile: __dirname + '/modules/angular1_router/karma-router.conf.js',
707-
singleRun: true, reporters: ['dots'], browsers: browserConf.browsersToRun}, done);
710+
new karma.Server({
711+
configFile: __dirname + '/modules/angular1_router/karma-router.conf.js',
712+
singleRun: true,
713+
reporters: ['dots'],
714+
browsers: browserConf.browsersToRun
715+
},
716+
done
717+
).start();
708718
});
709719

710720
gulp.task('test.unit.js/ci', function (done) {
711721
var browserConf = getBrowsersFromCLI();
712-
karma.server.start({configFile: __dirname + '/karma-js.conf.js',
713-
singleRun: true, reporters: ['dots'], browsers: browserConf.browsersToRun}, done);
722+
new karma.Server({
723+
configFile: __dirname + '/karma-js.conf.js',
724+
singleRun: true,
725+
reporters: ['dots'],
726+
browsers: browserConf.browsersToRun
727+
},
728+
done
729+
).start();
714730
});
715731

716732
gulp.task('test.unit.js.sauce/ci', function (done) {
717-
karma.server.start({configFile: __dirname + '/karma-js.conf.js',
718-
singleRun: true, browserNoActivityTimeout: 240000, captureTimeout: 120000,
719-
reporters: ['dots', 'saucelabs'], browsers: sauceConf.aliases.CI},
720-
function(err) {done(); process.exit(err ? 1 : 0);});
733+
new karma.Server({
734+
configFile: __dirname + '/karma-js.conf.js',
735+
singleRun: true,
736+
browserNoActivityTimeout: 240000,
737+
captureTimeout: 120000,
738+
reporters: ['dots', 'saucelabs'],
739+
browsers: sauceConf.aliases.CI
740+
},
741+
function(err) {done(); process.exit(err ? 1 : 0);}
742+
).start();
721743
});
722744

723745
gulp.task('test.unit.dart/ci', function (done) {
724746
var browserConf = getBrowsersFromCLI();
725-
karma.server.start({configFile: __dirname + '/karma-dart.conf.js',
726-
singleRun: true, reporters: ['dots'], browsers: browserConf.browsersToRun}, done);
747+
new karma.Server({
748+
configFile: __dirname + '/karma-dart.conf.js',
749+
singleRun: true,
750+
reporters: ['dots'],
751+
browsers: browserConf.browsersToRun
752+
},
753+
done
754+
).start();
727755
});
728756

729757

0 commit comments

Comments
 (0)
X Tutup