Skip to content

Commit 5a80156

Browse files
committed
test: increase read file abort coverage
1 parent c380ee6 commit 5a80156

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
@@ -75,3 +75,11 @@ for (const e of fileInfo) {
7575
}));
7676
process.nextTick(() => controller.abort());
7777
}
78+
{
79+
// Verify that if something different than Abortcontroller.signal
80+
// is passed, ERR_INVALID_ARG_TYPE is thrown
81+
assert.throws(() => {
82+
const callback = common.mustNotCall(() => {});
83+
fs.readFile(fileInfo[0].name, { signal: 'hello' }, callback);
84+
}, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' });
85+
}

0 commit comments

Comments
 (0)