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 <[email protected]>
Reviewed-By: Zijian Liu <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
shootermv authored and targos committed May 1, 2021
1 parent b353549 commit 8f580df
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 @@ -76,3 +76,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 8f580df

Please sign in to comment.