-
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: removed literal from assert #16805
Conversation
I'm not sure that removing this allows for a more helpful error message. |
@mscdex How about we restore the error message but also include @awegrzyn Can you change it to something like this?: assert.strictEqual(
c.value,
42,
`require(".") should honor NODE_PATH; expected 42, found ${c.value}`
); |
test/parallel/test-require-dot.js
Outdated
@@ -15,4 +15,4 @@ m._initPaths(); | |||
|
|||
const c = require('.'); | |||
|
|||
assert.strictEqual(c.value, 42, 'require(".") should honor NODE_PATH'); | |||
assert.strictEqual(c.value, 42, `require(".") should honor NODE_PATH; expected 42, found ${c.value}`); |
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 line will be well beyond 80 chars. Can you please format it ? hint: follow @Trott 's suggestion
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
Include the value that differed from the expected value in an assertion message in test-require-dot. PR-URL: nodejs#16805 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Landed in d520059. |
Include the value that differed from the expected value in an assertion message in test-require-dot. PR-URL: #16805 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Include the value that differed from the expected value in an assertion message in test-require-dot. PR-URL: #16805 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Include the value that differed from the expected value in an assertion message in test-require-dot. PR-URL: #16805 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Include the value that differed from the expected value in an assertion message in test-require-dot. PR-URL: #16805 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Include the value that differed from the expected value in an assertion message in test-require-dot. PR-URL: #16805 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Removed literal from assert to display default message.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test