From 850c2a72eab7bb4440a11830113e88c9f2b7d724 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 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'); }));