fix(gulp): use the new karma.Server api

Closes #4375
This commit is contained in:
Igor Minar 2015-09-26 20:26:02 -07:00
parent e21bf120b9
commit 758efba34b
1 changed files with 43 additions and 15 deletions

View File

@ -610,21 +610,21 @@ gulp.task('test.unit.js', ['build.js.dev'], function (done) {
gulp.task('test.unit.js.sauce', ['build.js.dev'], function (done) {
var browserConf = getBrowsersFromCLI();
if (browserConf.isSauce) {
karma.server.start({
new karma.Server({
configFile: __dirname + '/karma-js.conf.js',
singleRun: true,
browserNoActivityTimeout: 240000,
captureTimeout: 120000,
reporters: ['dots'],
browsers: browserConf.browsersToRun},
function(err) {done(); process.exit(err ? 1 : 0);});
function(err) {done(); process.exit(err ? 1 : 0);}).start();
} else {
throw new Error('ERROR: no Saucelabs browsers provided, add them with the --browsers option');
}
});
gulp.task('!test.unit.js/karma-server', function() {
karma.server.start({configFile: __dirname + '/karma-js.conf.js', reporters: 'dots'});
new karma.Server({configFile: __dirname + '/karma-js.conf.js', reporters: 'dots'}).start();
});
@ -647,7 +647,11 @@ gulp.task('test.unit.router', function (done) {
});
gulp.task('!test.unit.router/karma-server', function() {
karma.server.start({configFile: __dirname + '/modules/angular1_router/karma-router.conf.js'});
new karma.Server({
configFile: __dirname + '/modules/angular1_router/karma-router.conf.js',
reporters: 'dots'
}
).start();
});
@ -697,33 +701,57 @@ gulp.task('!test.unit.dart/karma-run', function (done) {
gulp.task('!test.unit.dart/karma-server', function() {
karma.server.start({configFile: __dirname + '/karma-dart.conf.js', reporters: 'dots'});
new karma.Server({configFile: __dirname + '/karma-dart.conf.js', reporters: 'dots'}).start();
});
gulp.task('test.unit.router/ci', function (done) {
var browserConf = getBrowsersFromCLI();
karma.server.start({configFile: __dirname + '/modules/angular1_router/karma-router.conf.js',
singleRun: true, reporters: ['dots'], browsers: browserConf.browsersToRun}, done);
new karma.Server({
configFile: __dirname + '/modules/angular1_router/karma-router.conf.js',
singleRun: true,
reporters: ['dots'],
browsers: browserConf.browsersToRun
},
done
).start();
});
gulp.task('test.unit.js/ci', function (done) {
var browserConf = getBrowsersFromCLI();
karma.server.start({configFile: __dirname + '/karma-js.conf.js',
singleRun: true, reporters: ['dots'], browsers: browserConf.browsersToRun}, done);
new karma.Server({
configFile: __dirname + '/karma-js.conf.js',
singleRun: true,
reporters: ['dots'],
browsers: browserConf.browsersToRun
},
done
).start();
});
gulp.task('test.unit.js.sauce/ci', function (done) {
karma.server.start({configFile: __dirname + '/karma-js.conf.js',
singleRun: true, browserNoActivityTimeout: 240000, captureTimeout: 120000,
reporters: ['dots', 'saucelabs'], browsers: sauceConf.aliases.CI},
function(err) {done(); process.exit(err ? 1 : 0);});
new karma.Server({
configFile: __dirname + '/karma-js.conf.js',
singleRun: true,
browserNoActivityTimeout: 240000,
captureTimeout: 120000,
reporters: ['dots', 'saucelabs'],
browsers: sauceConf.aliases.CI
},
function(err) {done(); process.exit(err ? 1 : 0);}
).start();
});
gulp.task('test.unit.dart/ci', function (done) {
var browserConf = getBrowsersFromCLI();
karma.server.start({configFile: __dirname + '/karma-dart.conf.js',
singleRun: true, reporters: ['dots'], browsers: browserConf.browsersToRun}, done);
new karma.Server({
configFile: __dirname + '/karma-dart.conf.js',
singleRun: true,
reporters: ['dots'],
browsers: browserConf.browsersToRun
},
done
).start();
});