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