mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
3cacd34dc2
Fixes: https://github.com/nodejs/node/issues/14957 PR-URL: https://github.com/nodejs/node/pull/16839 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
17 lines
537 B
JavaScript
17 lines
537 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const cp = require('child_process');
|
|
|
|
if (process.argv[2] === 'child') {
|
|
// The following console.log() call is part of the test's functionality.
|
|
console.log(process.ppid);
|
|
} else {
|
|
const child = cp.spawnSync(process.execPath, [__filename, 'child']);
|
|
|
|
assert.strictEqual(child.status, 0);
|
|
assert.strictEqual(child.signal, null);
|
|
assert.strictEqual(+child.stdout.toString().trim(), process.pid);
|
|
assert.strictEqual(child.stderr.toString().trim(), '');
|
|
}
|