I may be missing something extremely obvious but I can't get gulp-mocha
to catch errors, causing my gulp watch
task to end everytime I have a failing test.
It's a very simple set up:
gulp.task("watch", ["build"], function () {
gulp.watch([paths.scripts, paths.tests], ["test"]);
});
gulp.task("test", function() {
return gulp.src(paths.tests)
.pipe(mocha({ reporter: "spec" }).on("error", gutil.log));
});
Alternatively, putting the handler on the entire stream also gives the same problem:
gulp.task("test", function() {
return gulp.src(paths.tests)
.pipe(mocha({ reporter: "spec" }))
.on("error", gutil.log);
});
I've also tried using plumber
, combine
and gulp-batch
to no avail, so I guess I'm overlooking something trivial.
mocha
symbol coming from in your code? (What defines it?)mocha = require("gulp-mocha")
true === false
for instance). Is the problem still present after this modification?