Skip to content

Commit

Permalink
test: increase read file abort coverage
Browse files Browse the repository at this point in the history
PR-URL: #36716
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
shootermv authored and benjamingr committed Jan 27, 2021
1 parent c9992a0 commit 8c3cdce
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/parallel/test-fs-readfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,11 @@ for (const e of fileInfo) {
}));
process.nextTick(() => controller.abort());
}
{
// Verify that if something different than Abortcontroller.signal
// is passed, ERR_INVALID_ARG_TYPE is thrown
assert.throws(() => {
const callback = common.mustNotCall(() => {});
fs.readFile(fileInfo[0].name, { signal: 'hello' }, callback);
}, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' });
}

0 comments on commit 8c3cdce

Please sign in to comment.