gulp-mocha
Advanced tools
Comparing version 2.1.1 to 2.1.2
11
index.js
@@ -6,2 +6,3 @@ 'use strict'; | ||
var Mocha = require('mocha'); | ||
var plur = require('plur'); | ||
@@ -13,3 +14,2 @@ module.exports = function (opts) { | ||
var cache = {}; | ||
var hasTests = false; | ||
@@ -34,6 +34,5 @@ for (var key in require.cache) { | ||
mocha.addFile(file.path); | ||
hasTests = true; | ||
this.queue(file); | ||
}, function () { | ||
var stream = this; | ||
var self = this; | ||
var d = domain.create(); | ||
@@ -47,3 +46,3 @@ var runner; | ||
clearCache(); | ||
stream.emit('error', new gutil.PluginError('gulp-mocha', err, { | ||
self.emit('error', new gutil.PluginError('gulp-mocha', err, { | ||
stack: err.stack, | ||
@@ -62,3 +61,3 @@ showStack: true | ||
if (errCount > 0) { | ||
stream.emit('error', new gutil.PluginError('gulp-mocha', errCount + ' ' + (errCount === 1 ? 'test' : 'tests') + ' failed.', { | ||
self.emit('error', new gutil.PluginError('gulp-mocha', errCount + ' ' + plur('test', errCount) + ' failed.', { | ||
showStack: false | ||
@@ -68,3 +67,3 @@ })); | ||
stream.emit('end'); | ||
self.emit('end'); | ||
}); | ||
@@ -71,0 +70,0 @@ } catch (err) { |
{ | ||
"name": "gulp-mocha", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Run Mocha tests", | ||
@@ -38,4 +38,5 @@ "license": "MIT", | ||
"mocha": "^2.0.1", | ||
"plur": "^1.0.0", | ||
"through": "^2.3.4" | ||
} | ||
} |
5630
4
59
+ Addedplur@^1.0.0
+ Addedplur@1.0.0(transitive)