Skip to content

Commit 8f580df

Browse files
shootermvtargos
authored andcommitted
test: increase read file abort coverage
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]>
1 parent b353549 commit 8f580df

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/parallel/test-fs-readfile.js

+8
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,11 @@ for (const e of fileInfo) {
7676
}));
7777
process.nextTick(() => controller.abort());
7878
}
79+
{
80+
// Verify that if something different than Abortcontroller.signal
81+
// is passed, ERR_INVALID_ARG_TYPE is thrown
82+
assert.throws(() => {
83+
const callback = common.mustNotCall(() => {});
84+
fs.readFile(fileInfo[0].name, { signal: 'hello' }, callback);
85+
}, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' });
86+
}

0 commit comments

Comments
 (0)