We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c308b06 commit cf8d025Copy full SHA for cf8d025
test/parallel/test-fs-promises-readfile.js
@@ -61,10 +61,22 @@ function validateReadFileAbortLogicDuring() {
61
});
62
}
63
64
+async function validateWrongSignalParam() {
65
+ // Verify that if something different than Abortcontroller.signal
66
+ // is passed, ERR_INVALID_ARG_TYPE is thrown
67
+
68
+ await assert.rejects(async () => {
69
+ const callback = common.mustNotCall(() => {});
70
+ await readFile(fn, { signal: 'hello' }, callback);
71
+ }, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' });
72
73
+}
74
75
(async () => {
76
await createLargeFile();
77
await validateReadFile();
78
await validateReadFileProc();
79
await validateReadFileAbortLogicBefore();
80
await validateReadFileAbortLogicDuring();
81
+ await validateWrongSignalParam();
82
})().then(common.mustCall());
0 commit comments