Skip to content

Commit da07eb6

Browse files
shootermvtargos
authored andcommitted
test: increase read file abort coverage
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>
1 parent c4193ba commit da07eb6

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
@@ -70,3 +70,11 @@ for (const e of fileInfo) {
7070
}));
7171
process.nextTick(() => controller.abort());
7272
}
73+
{
74+
// Verify that if something different than Abortcontroller.signal
75+
// is passed, ERR_INVALID_ARG_TYPE is thrown
76+
assert.throws(() => {
77+
const callback = common.mustNotCall(() => {});
78+
fs.readFile(fileInfo[0].name, { signal: 'hello' }, callback);
79+
}, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' });
80+
}

0 commit comments

Comments
 (0)