Skip to content

Commit

Permalink
emit error on test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Apr 9, 2014
1 parent 96a64ee commit 0cd7c9a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,16 @@ module.exports = function (options) {
isVerbose: options.verbose,
includeStackTrace: options.includeStackTrace,
defaultTimeoutInterval: options.timeout,
onComplete: function () {cb()},
showColors: color
showColors: color,
onComplete: function (arg) {
var failedCount = arg.env.currentSpec.results().failedCount;

if (failedCount > 0) {
this.emit('error', new gutil.PluginError('gulp-jasmine', failedCount + ' failure'));
}

cb();
}.bind(this)
});
} catch (err) {
this.emit('error', new gutil.PluginError('gulp-jasmine', err));
Expand Down

0 comments on commit 0cd7c9a

Please sign in to comment.