-
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: improve test-fs-access error validation #10988
Conversation
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 if CI is green.
test/parallel/test-fs-access.js
Outdated
@@ -92,15 +92,15 @@ fs.access(readOnlyFile, fs.W_OK, common.mustCall((err) => { | |||
|
|||
assert.throws(() => { | |||
fs.access(100, fs.F_OK, (err) => {}); |
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: err
is unused. Remove it?
Nit: While we're in here refactoring, maybe change the rocket function on lines 117-119 from this: (err) => {
return err.code === 'ENOENT' && err.path === doesNotExist;
} ...to this?: (err) => (err.code === 'ENOENT' && err.path === doesNotExist) Both styles show up in our code base, but the latter (no unnecessary braces + return) is far more common and I'd like to see things inch towards a common style that can then be enforced by a lint rule. |
use better RegExp to validate the errors in assert.throws
cefca82
to
02f893e
Compare
@Trott , did the Nits... sorry it took a little bit... had a hard week |
Closing this one in favor of #11087 |
use better RegExp to validate the errors in assert.throws
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test