samedi 30 janvier 2016

gulp-mocha halts on first failed test

When running gulp-mocha, if an unhandled error occurs during a test, I'd like that specific test to fail, but the remaining tests to continue. Currently, gulp-mocha halts on the first test which throws an error and outputs the error to the console. I'm running my tests as gulp test, here is my gulp task:

gulp.task("test", ["build"], () => {
    return gulp
        .src("./out/test/*.js", { read: false })
        .pipe(mocha({ reporter: "spec" }))
        .on("error", () => false);
});

If I run my tests directly via mocha ./out/test/, all tests are run regardless of outcome and the errors are shown at the end of the test run. This is what I want.

Aucun commentaire:

Enregistrer un commentaire