diff --git a/index.js b/index.js index e94272d..36c28dc 100644 --- a/index.js +++ b/index.js @@ -47,14 +47,13 @@ module.exports = function(opt) { gutil.beep(); }); + var self = this; child.on('close', function(code) { + self.emit('end'); if(code !== 0) { new gutil.PluginError(PLUGIN_NAME, 'Tests failed'); } }); - - - this.emit('end'); }