X Tutup
The Wayback Machine - https://web.archive.org/web/20230222013836/https://github.com/nodejs/node/commit/cf8d025207
Skip to content
Permalink
Browse files
test: increase abort logic coverage
PR-URL: #36586
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
shootermv authored and targos committed May 1, 2021
1 parent c308b06 commit cf8d025
Showing 1 changed file with 12 additions and 0 deletions.
@@ -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());

0 comments on commit cf8d025

Please sign in to comment.
X Tutup