mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
test: increase abort logic coverage
PR-URL: https://github.com/nodejs/node/pull/36586 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
1 parent
c308b06483
commit
cf8d025207
1 file changed
+12
@@ -61,10 +61,22 @@ function validateReadFileAbortLogicDuring() {
|
||||
});
|
||||
}
|
||||
|
||||
async function validateWrongSignalParam() {
|
||||
// Verify that if something different than Abortcontroller.signal
|
||||
// is passed, ERR_INVALID_ARG_TYPE is thrown
|
||||
|
||||
await assert.rejects(async () => {
|
||||
const callback = common.mustNotCall(() => {});
|
||||
await readFile(fn, { signal: 'hello' }, callback);
|
||||
}, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' });
|
||||
|
||||
}
|
||||
|
||||
(async () => {
|
||||
await createLargeFile();
|
||||
await validateReadFile();
|
||||
await validateReadFileProc();
|
||||
await validateReadFileAbortLogicBefore();
|
||||
await validateReadFileAbortLogicDuring();
|
||||
await validateWrongSignalParam();
|
||||
})().then(common.mustCall());
|
||||
Reference in new issue
Block a user