-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
child_process: exec's promisify impl now includes stdout/err in error #13388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
e44a057
e2182e5
6adbd98
e37cb7e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,21 +33,21 @@ const execFile = promisify(child_process.execFile); | |
| })); | ||
| } | ||
| const failingCodeWithStdoutErr = | ||
| 'console.log("out");console.error("err");process.exit(1)'; | ||
| 'console.log(42);console.error(42);process.exit(1)'; | ||
| { | ||
| exec(`${process.execPath} -e '${failingCodeWithStdoutErr}'`) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this work on Windows? I think there was some weirdness with single/double quotes. (If you don’t know, that’s okay; CI will tell us.)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "A wise man does not fall into a hole that a smart man can get out of" :-). I'll change it to output numbers and then use double quotes like the other tests. |
||
| .catch(common.mustCall((err) => { | ||
| assert.strictEqual(err.code, 1); | ||
| assert.strictEqual(err.stdout, 'out\n'); | ||
| assert.strictEqual(err.stderr, 'err\n'); | ||
| assert.strictEqual(err.stdout, '42\n'); | ||
| assert.strictEqual(err.stderr, '43\n'); | ||
| })); | ||
| } | ||
|
|
||
| { | ||
| execFile(process.execPath, ['-e', failingCodeWithStdoutErr]) | ||
| .catch(common.mustCall((err) => { | ||
| assert.strictEqual(err.code, 1); | ||
| assert.strictEqual(err.stdout, 'out\n'); | ||
| assert.strictEqual(err.stderr, 'err\n'); | ||
| assert.strictEqual(err.stdout, '42\n'); | ||
| assert.strictEqual(err.stderr, '43\n'); | ||
| })); | ||
| } | ||
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.
These two functions are nearly identical. It should be okay, but it shouldn’t be too hard to merge these, right?
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.
Will do