Skip to content
Permalink
Browse files

fs: cover fs.opendir ERR_INVALID_CALLBACK

PR-URL: #30307
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
darky authored and MylesBorins committed Nov 6, 2019
1 parent 217cc13 commit 7ba8037244acd754e36e14ed46dd3fd2666ffeb2
Showing with 4 additions and 0 deletions.
  1. +4 −0 test/parallel/test-fs-opendir.js
@@ -86,6 +86,10 @@ assert.throws(function() {
fs.opendirSync(__filename);
}, /Error: ENOTDIR: not a directory/);

assert.throws(function() {
fs.opendir(__filename);
}, /TypeError \[ERR_INVALID_CALLBACK\]: Callback must be a function/);

fs.opendir(__filename, common.mustCall(function(e) {
assert.strictEqual(e.code, 'ENOTDIR');
}));

0 comments on commit 7ba8037

Please sign in to comment.
You can’t perform that action at this time.