-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
test: show actual assertion error message with value #20956
Conversation
const assert = require('assert'); | ||
|
||
process.on('exit', () => { | ||
assert.strictEqual(process._exiting, true, 'process._exiting was not set!'); | ||
// process._exiting was not set! |
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.
Nit: I think the comment is not needed.
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.
Sure, Actually this is my first PR, and not sure why windows test failed
I am a mac user, is there anything I can do to fix it?
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.
The failure is unrelated, don't worry about that.
@thatshailesh would you be so kind and rebase? Seems like you accidentally added the latest commit and that has to be backed out again. |
@BridgeAR Sorry, I just did rebase, now only my commits are showing |
process.nextTick(() => { | ||
assert.fail('process is exiting, should not be called.'); | ||
}); | ||
process.nextTick(common.mustNotCall()); |
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.
How about this?:
process.nextTick(common.mustNotCall('process is exiting, should not be called'));
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.
Done
Looks like you may have accidentally included a package-lock.json update too? You can remove that change, I would think, or whoever is landing this can remove it. (The removed change will probably be the same change proposed in #20970.) |
on process exit if some assertion error occurs value of `process._exiting` was hidden, this fix will show the actual error message with value
@Trott ok I have removed it, thanks 👍 |
Landed in 8055bdb Congrats on your first contribution @thatshailesh! |
On process exit if some assertion error occurs value of `process._exiting` was hidden, this fix will show the actual error message with value. PR-URL: #20956 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
@apapirovski @Trott Thanks for the help 👍 |
On process exit if some assertion error occurs value of `process._exiting` was hidden, this fix will show the actual error message with value. PR-URL: #20956 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
on process exit if some assertion error occurs value of
process._exiting
was hidden, this fix will show the actual error message with value
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes