-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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: Z lib const descriptive failure messages #15977
test: Z lib const descriptive failure messages #15977
Conversation
[ | ||
'Expected Z_OK to be 0;', | ||
`got ${zlib.constants.Z_OK}` | ||
].join(' ')); |
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'm not a fan of this formatting, but I had to adhere to linter rules; specifically, max line length of 80. I would prefer format like this:
assert.strictEqual(zlib.codes.Z_OK, 0,
`Z_OK should be immutable. Expected to get 0, got ${zlib.codes.Z_OK}`);
What would folks think about overriding the max-line-length linter rule to 120 characters for this file?
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.
That is what is done in test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js
by adding /* eslint-disable max-len */
.
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.
Ah, nice. That's what I had in mind to do. Guess I didn't want to rock the linting rules boat on my first contribution to Node, eh? Ha! Will override here.
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 would also work
assert.strictEqual(
zlib.constants.Z_OK,
0,
`Expected Z_OK to be 0; got ${zlib.constants.Z_OK}`
);
Deactiviating the max-len is not a good idea.
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.
It would be nice to have the suggested formatting but this is not a must out of my perspective.
The subsystem is wrong right now and has to be changed while landing.
CI is ✔️ |
PR-URL: nodejs#15977 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Landed in 91724cb Thanks for the PR, and congratulations on becoming a Node.js Contributor 🎉 ! |
PR-URL: #15977 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
PR-URL: nodejs/node#15977 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
More informative failure messages for ZLib constants tests. Using template literals to output the actual value in addition to expected.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test