mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
1) Add missing lazy assert call 2) Remove obsolete error type 3) Name undocumented error type more appropriate 4) Consolidate error type style (rely on util.format instead of using a function) 5) Uppercase the first letter from error messages 6) Improve some internal error parameters PR-URL: https://github.com/nodejs/node/pull/13857 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
31 lines
754 B
JavaScript
31 lines
754 B
JavaScript
'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);
|
|
}
|
|
}));
|