test: improve test coverage for fs module
Covering the case when fs-read get invalid argument for file handle PR-URL: https://github.com/nodejs/node/pull/23601 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit is contained in:
parent
849aa1e504
commit
c24e9633fb
@ -75,3 +75,11 @@ assert.throws(
|
||||
code: 'ERR_INVALID_CALLBACK',
|
||||
}
|
||||
);
|
||||
|
||||
assert.throws(
|
||||
() => fs.read(null, Buffer.alloc(1), 0, 1, 0),
|
||||
{
|
||||
message: 'The "fd" argument must be of type number. Received type object',
|
||||
code: 'ERR_INVALID_ARG_TYPE',
|
||||
}
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user