I have a standard gulp watchdog and runner for my Node.js / mocha installation;
gulp.task('mocha', function() { process.env.NODE_ENV = 'test'; return gulp.src(['./test/**/*.js'], {read: false}) .pipe(mocha({ recursive: true, reporter: 'list', ui: 'bdd' })).on('error', gutil.log); }); gulp.task('tests', function() { gulp.watch(sources.concat(tests), ['mocha']); });
I am wondering how to adapt my task (and another) to send only the mocha test, which has changed - so I do not need to wait 20 seconds to run hundreds of tests.
I tried this with fgulp-newer and gulp -cached but no luck.
I am looking here for an answer or a pseudo-algorithm for a gulp plugin that I could write for this purpose :)
source share