-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: improve assert message #15909
test: improve assert message #15909
Conversation
Hi, @tnguyen14! Welcome and thanks! This change doesn't address the issue that was requested in the Code + Learn task. It still masks that actual values. That is: The message is a string literal that does not provide the contents of the variables that are being compared. There are two possible ways to address this. One is to remove the message entirely and allow The other way is to change the string literal to a template string and use Can you update this to use one of those instead? |
Thanks for the quick response @Trott. I tried both of the solutions you mentioned. When removing the message completely, the default message is not entirely useful. It would show something like
(I made Using I discussed with @mhdawson briefly, and he suggested that it's best to put in an error message that makes the most sense for developers to debug the issue in the case of failure. Please let me know if you think it's best to drop the error message entirely. |
I'd be +1 on dropping the error message entirely. |
I agree with @gibfahn. I think the error message you show when the message argument has been removed entirely is actually quite useful. |
a37ea43
to
e9618b7
Compare
Updated the assertion to remove the message. |
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
PR-URL: nodejs#15909 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Landed in b6a87db. |
PR-URL: nodejs/node#15909 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: #15909 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: #15909 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: #15909 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: #15909 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: #15909 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
First contribution for Node.js Interactive
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes(https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#commit-message-guidelines)
Affected core subsystem(s)
test