Skip to content

Commit

Permalink
Make gulp test task fails when some test fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Toilal committed Jan 17, 2015
1 parent 03c0ca3 commit cc71277
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ gulp.task('static', function () {
});

gulp.task('test', function (cb) {
var mochaErr;

gulp.src([
'lib/**/*.js',
'index.js'
Expand All @@ -48,8 +50,13 @@ gulp.task('test', function (cb) {
.pipe(mocha({
reporter: 'spec'
}))
.on('error', function (err) {
mochaErr = err;
})
.pipe(istanbul.writeReports())
.on('end', cb);
.on('end', function () {
cb(mochaErr);
});
});
});

Expand Down

0 comments on commit cc71277

Please sign in to comment.