mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
754 B
30 lines
754 B
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const cp = require('child_process');
|
|
const path = require('path');
|
|
const fixture = path.join(common.fixturesDir, 'empty.js');
|
|
const child = cp.fork(fixture);
|
|
|
|
child.on('close', common.mustCall((code, signal) => {
|
|
assert.strictEqual(code, 0);
|
|
assert.strictEqual(signal, null);
|
|
|
|
const testError = common.expectsError({
|
|
type: Error,
|
|
message: 'Channel closed',
|
|
code: 'ERR_IPC_CHANNEL_CLOSED'
|
|
});
|
|
|
|
child.on('error', common.mustCall(testError));
|
|
|
|
{
|
|
const result = child.send('ping');
|
|
assert.strictEqual(result, false);
|
|
}
|
|
|
|
{
|
|
const result = child.send('pong', common.mustCall(testError));
|
|
assert.strictEqual(result, false);
|
|
}
|
|
}));
|
|
|