From d4b61709f156441653dd1d7a6452a369f7de6d5d Mon Sep 17 00:00:00 2001 From: Dmitriy Kikinskiy Date: Wed, 6 Nov 2019 17:16:17 +0300 Subject: [PATCH] test: dir class initialisation w/o handler Covering the case when init Dir class without passing handle paramd to constructor. PR-URL: https://github.com/nodejs/node/pull/30313 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: David Carlier Reviewed-By: Gireesh Punathil Reviewed-By: Ruben Bridgewater Reviewed-By: Trivikram Kamat --- test/parallel/test-fs-read.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/parallel/test-fs-read.js b/test/parallel/test-fs-read.js index 9d9cf0db3a7655..e6fe6231ffd9ec 100644 --- a/test/parallel/test-fs-read.js +++ b/test/parallel/test-fs-read.js @@ -68,6 +68,10 @@ test(new Uint8Array(expected.length), })); } +assert.throws(() => new fs.Dir(), { + code: 'ERR_MISSING_ARGS', +}); + assert.throws( () => fs.read(fd, Buffer.alloc(1), 0, 1, 0), {