Improve test watching

This commit is contained in:
Aaron Jensen 2015-08-05 22:48:07 -07:00
parent 90275489c4
commit 6ee1e3346b
3 changed files with 5 additions and 14 deletions

View File

@ -3,7 +3,6 @@ var path = require('path');
var gulp = require('gulp');
var babel = require('gulp-babel');
var batch = require('gulp-batch');
var eslint = require('gulp-eslint');
var excludeGitignore = require('gulp-exclude-gitignore');
var mocha = require('gulp-mocha');
@ -55,14 +54,12 @@ gulp.task('babel', function() {
.pipe(gulp.dest('dist'));
});
gulp.task('watch', function(done) {
gulp.watch(['lib/**/*.js', 'test/**/*.js'], batch(function(events, batchDone) {
gulp.start('test:node', batchDone);
}));
gulp.task('watch', function() {
gulp.start(['test:node']);
gulp.watch(['lib/**/*.js', 'test/**/*.js'], ['test:node']);
new KarmaServer({
configFile: path.join(__dirname, 'karma.conf.js'),
}, done).start();
}).start();
});
gulp.task('webpack', ['webpack:standalone', 'webpack:standalone:min']);

View File

@ -16,7 +16,7 @@ module.exports = function(config) {
// list of files / patterns to load in the browser
files: [
'test/**/*.js',
{ pattern: 'test/**/*.js', watched: false, included: true, served: true },
],
// list of files to exclude
@ -55,11 +55,6 @@ module.exports = function(config) {
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],

View File

@ -38,7 +38,6 @@
"eslint-config-airbnb": "0.0.7",
"gulp": "^3.6.0",
"gulp-babel": "^5.1.0",
"gulp-batch": "^1.0.5",
"gulp-eslint": "^0.15.0",
"gulp-exclude-gitignore": "^1.0.0",
"gulp-mocha": "^2.0.0",