diff options
Diffstat (limited to 'test/parallel/test-child-process-internal.js')
-rw-r--r-- | test/parallel/test-child-process-internal.js | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/test/parallel/test-child-process-internal.js b/test/parallel/test-child-process-internal.js index e6db1f82a0..f3e452ef87 100644 --- a/test/parallel/test-child-process-internal.js +++ b/test/parallel/test-child-process-internal.js @@ -1,5 +1,5 @@ 'use strict'; -require('../common'); +const common = require('../common'); var assert = require('assert'); //messages @@ -21,18 +21,11 @@ if (process.argv[2] === 'child') { var fork = require('child_process').fork; var child = fork(process.argv[1], ['child']); - var gotNormal; - child.once('message', function(data) { - gotNormal = data; - }); + child.once('message', common.mustCall(function(data) { + assert.deepStrictEqual(data, normal); + })); - var gotInternal; - child.once('internalMessage', function(data) { - gotInternal = data; - }); - - process.on('exit', function() { - assert.deepStrictEqual(gotNormal, normal); - assert.deepStrictEqual(gotInternal, internal); - }); + child.once('internalMessage', common.mustCall(function(data) { + assert.deepStrictEqual(data, internal); + })); } |