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 <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>
  • Loading branch information
leomoreno authored and jasnell committed Oct 17, 2018
1 parent 278775a commit db2be04
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 db2be04

Please sign in to comment.