From 6ee1e3346b93ac22a0c9cfb7232b3d4f617729ad Mon Sep 17 00:00:00 2001 From: Aaron Jensen Date: Wed, 5 Aug 2015 22:48:07 -0700 Subject: [PATCH] Improve test watching --- gulpfile.js | 11 ++++------- karma.conf.js | 7 +------ package.json | 1 - 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 0eb9d66..15627c4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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']); diff --git a/karma.conf.js b/karma.conf.js index bab8446..87e6be3 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -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'], diff --git a/package.json b/package.json index c9b08b8..8b1a14c 100644 --- a/package.json +++ b/package.json @@ -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",