Skip to content

Commit

Permalink
test: increase coverage for fs/dir read
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Lxxyx authored and targos committed Dec 21, 2020
1 parent 68687d3 commit 109ab78
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/parallel/test-fs-opendir.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@ async function doConcurrentAsyncAndSyncOps() {
}
doConcurrentAsyncAndSyncOps().then(common.mustCall());

// Check read throw exceptions on invalid callback
{
const dir = fs.opendirSync(testDir);
assert.throws(() => dir.read('INVALID_CALLBACK'), /ERR_INVALID_CALLBACK/);
}

// Check that concurrent read() operations don't do weird things.
async function doConcurrentAsyncOps() {
const dir = await fs.promises.opendir(testDir);
Expand Down

0 comments on commit 109ab78

Please sign in to comment.