test: increase test coverage for readfile with withFileTypes option#23557
Closed
christian-bromann wants to merge 1 commit intonodejs:masterfrom
Closed
test: increase test coverage for readfile with withFileTypes option#23557christian-bromann wants to merge 1 commit intonodejs:masterfrom
christian-bromann wants to merge 1 commit intonodejs:masterfrom
Conversation
addaleax
approved these changes
Oct 12, 2018
BridgeAR
reviewed
Oct 12, 2018
Member
There was a problem hiding this comment.
As a suggestion:
To test the actual error it would be best to rewrite this to e.g.,:
fs.readdir(__filename, { withFileTypes: true }, common.expectsError({
message: 'FOOBAR',
name: 'ErrorName',
...
});
Contributor
Author
There was a problem hiding this comment.
@BridgeAR the error is actually passed within the fs.readdir callback, how about:
fs.readdir(__filename, {
withFileTypes: true
}, common.mustCall((err) => {
assert.throws(
() => { throw err; },
{
code: 'ENOTDIR',
name: 'Error',
message: `ENOTDIR: not a directory, scandir '${__filename}'`
}
);
}));
Member
There was a problem hiding this comment.
Right, sorry, I made a mistake when writing the example. I just updated it.
cjihrig
approved these changes
Oct 13, 2018
gireeshpunathil
approved these changes
Oct 13, 2018
According to the test coverage report a test case was missings checking if an error is passed into the callback for readdir calls with withFileTypes option.
e07d92b to
e4151af
Compare
Member
jasnell
approved these changes
Oct 17, 2018
Contributor
Member
|
Landed in 6c5e97f Thanks for the contribution! 🎉 (If you're interested in other possible contributions to Node.js but don't have a good idea of where to start looking, some ideas are posted at https://www.nodetodo.org/next-steps/.) |
addaleax
pushed a commit
that referenced
this pull request
Oct 21, 2018
According to the test coverage report a test case was missings checking if an error is passed into the callback for readdir calls with withFileTypes option. PR-URL: #23557 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
jasnell
pushed a commit
that referenced
this pull request
Oct 21, 2018
According to the test coverage report a test case was missings checking if an error is passed into the callback for readdir calls with withFileTypes option. PR-URL: #23557 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Nov 26, 2018
According to the test coverage report a test case was missings checking if an error is passed into the callback for readdir calls with withFileTypes option. PR-URL: #23557 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Closed
rvagg
pushed a commit
that referenced
this pull request
Nov 28, 2018
According to the test coverage report a test case was missings checking if an error is passed into the callback for readdir calls with withFileTypes option. PR-URL: #23557 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Nov 29, 2018
According to the test coverage report a test case was missings checking if an error is passed into the callback for readdir calls with withFileTypes option. PR-URL: #23557 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
According to the test coverage report a test case was missings checking
if an error is passed into the callback for readdir calls with withFileTypes
option.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes