diff options
Diffstat (limited to 'test/parallel/test-child-process-buffering.js')
-rw-r--r-- | test/parallel/test-child-process-buffering.js | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/test/parallel/test-child-process-buffering.js b/test/parallel/test-child-process-buffering.js index 1efa5a65f9..29ea8b5c45 100644 --- a/test/parallel/test-child-process-buffering.js +++ b/test/parallel/test-child-process-buffering.js @@ -2,10 +2,6 @@ var common = require('../common'); var assert = require('assert'); -var pwd_called = false; -var childClosed = false; -var childExited = false; - function pwd(callback) { var output = ''; var child = common.spawnPwd(); @@ -16,17 +12,14 @@ function pwd(callback) { output += s; }); - child.on('exit', function(c) { + child.on('exit', common.mustCall(function(c) { console.log('exit: ' + c); assert.equal(0, c); - childExited = true; - }); + })); - child.on('close', function() { + child.on('close', common.mustCall(function() { callback(output); - pwd_called = true; - childClosed = true; - }); + })); } @@ -35,9 +28,3 @@ pwd(function(result) { assert.equal(true, result.length > 1); assert.equal('\n', result[result.length - 1]); }); - -process.on('exit', function() { - assert.equal(true, pwd_called); - assert.equal(true, childExited); - assert.equal(true, childClosed); -}); |