Skip to content

Commit 109ab78

Browse files
Lxxyxtargos
authored andcommitted
test: increase coverage for fs/dir read
test invalid callback case for fs/dir read Refs: https://coverage.nodejs.org/coverage-f7dd330ba0e7bfa9/lib/internal/fs/dir.js.html#L91 PR-URL: #36388 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 68687d3 commit 109ab78

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/parallel/test-fs-opendir.js

+6
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,12 @@ async function doConcurrentAsyncAndSyncOps() {
244244
}
245245
doConcurrentAsyncAndSyncOps().then(common.mustCall());
246246

247+
// Check read throw exceptions on invalid callback
248+
{
249+
const dir = fs.opendirSync(testDir);
250+
assert.throws(() => dir.read('INVALID_CALLBACK'), /ERR_INVALID_CALLBACK/);
251+
}
252+
247253
// Check that concurrent read() operations don't do weird things.
248254
async function doConcurrentAsyncOps() {
249255
const dir = await fs.promises.opendir(testDir);

0 commit comments

Comments
 (0)