Skip to content

Commit 8e7a12f

Browse files
leomorenoMylesBorins
authored andcommitted
test: improve test coverage for fs module
Covering the case when fs-read get invalid argument for file handle PR-URL: #23601 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
1 parent 0b7aa27 commit 8e7a12f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/parallel/test-fs-read.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,11 @@ test(new Uint8Array(expected.length),
6868
assert.strictEqual(nRead, 0);
6969
}));
7070
}
71+
72+
assert.throws(
73+
() => fs.read(null, Buffer.alloc(1), 0, 1, 0),
74+
{
75+
message: 'The "fd" argument must be of type number. Received type object',
76+
code: 'ERR_INVALID_ARG_TYPE',
77+
}
78+
);

0 commit comments

Comments
 (0)