Skip to content

Commit

Permalink
test: increase read file abort coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
shootermv committed Jan 1, 2021
1 parent c380ee6 commit 5a80156
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 @@ -75,3 +75,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 5a80156

Please sign in to comment.