Skip to content

Commit

Permalink
fs: cover fs.opendir ERR_INVALID_CALLBACK
Browse files Browse the repository at this point in the history
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 addaleax committed Nov 30, 2019
1 parent 0285aa0 commit 850c2a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/parallel/test-fs-opendir.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,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');
}));
Expand Down

0 comments on commit 850c2a7

Please sign in to comment.