Skip to content

Commit

Permalink
test: improve test coverage for fs module
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
leomoreno authored and Trott committed Oct 13, 2018
1 parent 849aa1e commit c24e963
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/parallel/test-fs-read.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
);

0 comments on commit c24e963

Please sign in to comment.