From b3ab02b2fe47eef3dfe27e65a64eec416d83d948 Mon Sep 17 00:00:00 2001 From: Vladislav Botvin Date: Wed, 6 Nov 2019 17:04:11 +0300 Subject: [PATCH] fs: cover fs.opendir ERR_INVALID_CALLBACK --- test/parallel/test-fs-opendir.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/parallel/test-fs-opendir.js b/test/parallel/test-fs-opendir.js index 05fded527fe7f1..04e6e890c33b39 100644 --- a/test/parallel/test-fs-opendir.js +++ b/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'); }));