Run karma during watch and use dots

This commit is contained in:
Aaron Jensen 2015-08-05 08:26:44 -07:00
parent 1e6fa4a18d
commit ad381207a9
2 changed files with 9 additions and 5 deletions

View File

@ -39,7 +39,7 @@ gulp.task('test', ['test:karma', 'test:node']);
gulp.task('test:node', function() { gulp.task('test:node', function() {
return gulp.src('test/**/*.js') return gulp.src('test/**/*.js')
.pipe(mocha({reporter: 'spec'})); .pipe(mocha({reporter: 'dot'}));
}); });
gulp.task('test:karma', function(done) { gulp.task('test:karma', function(done) {
@ -55,10 +55,14 @@ gulp.task('babel', function() {
.pipe(gulp.dest('dist')); .pipe(gulp.dest('dist'));
}); });
gulp.task('watch', function() { gulp.task('watch', function(done) {
gulp.watch(['lib/**/*.js', 'test/**/*.js'], batch(function(events, done) { gulp.watch(['lib/**/*.js', 'test/**/*.js'], batch(function(events, batchDone) {
gulp.start('test:node', done); gulp.start('test:node', batchDone);
})); }));
new KarmaServer({
configFile: path.join(__dirname, 'karma.conf.js'),
}, done).start();
}); });
gulp.task('webpack', ['webpack:standalone', 'webpack:standalone:min']); gulp.task('webpack', ['webpack:standalone', 'webpack:standalone:min']);

View File

@ -40,7 +40,7 @@ module.exports = function(config) {
// test results reporter to use // test results reporter to use
// possible values: 'dots', 'progress' // possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter // available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['mocha'], reporters: ['dots'],
// web server port // web server port