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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • 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.