Uh oh!
There was an error while loading. Please reload this page.
test: add cb error test for fs.close method - #29970
Conversation
Fishrock123
commented
Oct 14, 2019
There was a problem hiding this comment.
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().)
Trott
commented
Oct 14, 2019
I wouldn't mind these new lines being block-scoped (add a |
Trott
commented
Oct 15, 2019
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? |
Trott
left a comment
There was a problem hiding this comment.
LGTM with a closeSync() added after the forEach stuff.
| const errObj = { | ||
| code: 'ERR_INVALID_CALLBACK', | ||
| name: 'TypeError' | ||
| }; |
There was a problem hiding this comment.
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.
teorossi82
commented
Oct 15, 2019
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 :-) |
nodejs-github-bot
commented
Oct 15, 2019
Trott
commented
Oct 15, 2019
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). |
nodejs-github-bot
commented
Oct 15, 2019
nodejs-github-bot
commented
Oct 15, 2019
nodejs-github-bot
commented
Oct 16, 2019
teorossi82
commented
Oct 16, 2019
@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? |
Trott
commented
Oct 16, 2019
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>
Trott
commented
Oct 16, 2019
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