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 MylesBorins committed Nov 29, 2018
1 parent 65b3732 commit 3e143df
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 @@ -68,3 +68,11 @@ test(new Uint8Array(expected.length),
assert.strictEqual(nRead, 0);
}));
}

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 3e143df

Please sign in to comment.