diff --git a/test/parallel/test-fs-opendir.js b/test/parallel/test-fs-opendir.js index 7ae6186b28518a..abfbb2bb701b03 100644 --- a/test/parallel/test-fs-opendir.js +++ b/test/parallel/test-fs-opendir.js @@ -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'); }));