-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes: #14957 PR-URL: #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>
- Loading branch information
1 parent
a1d7469
commit 2d4fca2
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'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(), ''); | ||
} |
2d4fca2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I ask why this has not been accepted yet? This is an incredibly useful feature.
2d4fca2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was merged 4 years ago and is in every currently-supported version of Node.js.
¯\(ツ)/¯