-
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: add cb error test for fs.close method #29970
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.
Please call fs.closeSync(fd)
at the bottom of the test file.
(Or, better, put the test case in a callback, and then have the close be async too. If you do that, make sure you wrap the callbacks in common.mustCall()
.)
I wouldn't mind these new lines being block-scoped (add a |
Out of curiosity, what caused you to write this test? Were you reviewing coverage.nodejs.org and this test is intended to add coverage where we currently don't have coverage? Or is there a different reason you're doing this? |
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 with a closeSync() added after the forEach stuff.
const errObj = { | ||
code: 'ERR_INVALID_CALLBACK', | ||
name: 'TypeError' | ||
}; |
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.
Minor nit-pick: You can move the errObj
definition outside of the forEach()
to below the fd
definition. This way, it's only being defined once.
I have just took a look to coverage.nodejs.org page and found that this piece of code was not covered. I would like to help you reach 100% coverage :-) |
CI (probably) won't pass until #29979 lands first. If a Collaborator wants to be the second fast-track approval on that PR, thumbs up at #29979 (comment). |
@Trott I have to do something to unlock problems with CI or it's not related to my changes and I just have to wait? |
CI is passing. The GitHub interface doesn't always update. Not sure if that's a problem with our bot or with GitHub or something else. But this is all good to go. You don't need to do anything but wait for someone to land it. Which I'm going to do right now! |
Provides some missing test coverage. PR-URL: #29970 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in e22efba. Thanks for the contribution! 🎉 |
Provides some missing test coverage. PR-URL: #29970 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Provides some missing test coverage. PR-URL: #29970 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Provides some missing test coverage. PR-URL: #29970 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Added test on fs.close method when callback is not a function.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes