From 7ba8037244acd754e36e14ed46dd3fd2666ffeb2 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/30307 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat Reviewed-By: Ruben Bridgewater Reviewed-By: Сковорода Никита Андреевич Reviewed-By: Gireesh Punathil Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- 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 f2c5d033451261..c979dda589eac6 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'); }));