-
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 pending exception error in napi tests #18413
Conversation
Shows the result of the wasPending in the error message if the assertion fails.
const exception_pending = test_exception.wasPending(); | ||
assert.strictEqual(exception_pending, true, | ||
'Expected exception to be pending, but' + | ||
`it was marked as ${exception_pending}`); |
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.
I think this change might be more confusing than helpful. Is "marked as false" going to help someone or confuse them?
How about this:
`Exception not pending as expected, .wasPending() returned ${exception_pending}`
const exception_pending = test_exception.wasPending(); | ||
assert.strictEqual(exception_pending, false, | ||
'Expected no exception to be pending, but' + | ||
` it was marked as ${exception_pending}`); |
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.
Same comment as above, although with the text changed to reverse the expectation.
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.
Thanks for the pull request. It's close, I think, but I'd like to see the text improved a little bit. What do you think?
Updated the error message for pending exceptions so that it was a bit more clear.
@Trott Thanks for the feedback, I wasn't quite sure what to put there. I updated the error messages. How do they look? |
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.
LGTM. Thanks for the pull request!
Landed in 0c16b18 |
Shows the result of the wasPending in the error message if the assertion fails. PR-URL: nodejs#18413 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Shows the result of the wasPending in the error message if the assertion fails. PR-URL: #18413 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Shows the result of the wasPending in the error message if the assertion fails. PR-URL: #18413 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Shows the result of the wasPending in the error message if the assertion fails. PR-URL: #18413 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Shows the result of the wasPending in the error message if the assertion fails. PR-URL: nodejs#18413 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Shows the result of the wasPending in the error message if the assertion fails. PR-URL: nodejs#18413 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Shows the result of the wasPending in the error message if the assertion fails. Backport-PR-URL: #19447 PR-URL: #18413 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Shows the result of the wasPending in the error message if the assertion fails. Backport-PR-URL: #19265 PR-URL: #18413 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Shows the result of the wasPending in the error message if the assertion fails. PR-URL: nodejs#18413 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Shows the result of the wasPending in the error message if the
assertion fails.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)