node/test/fixtures/child-process-spawn-node.js
James M Snell d0c0e20bc2 test: refactoring / cleanup on child-process tests
PR-URL: https://github.com/nodejs/node/pull/32078
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-03-24 11:21:00 -07:00

12 lines
278 B
JavaScript

const assert = require('assert');
const debug = require('util').debuglog('test');
function onmessage(m) {
debug('CHILD got message:', m);
assert.ok(m.hello);
process.removeListener('message', onmessage);
}
process.on('message', onmessage);
process.send({ foo: 'bar' });