From 47d4d6ab161a828df36c460d6c0432cd25d69ecf Mon Sep 17 00:00:00 2001 From: Ralph Guderlei Date: Wed, 2 Dec 2015 13:47:46 +0100 Subject: [PATCH] emit 'end' when child process terminates --- index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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'); }