MCPcopy Create free account
hub / github.com/nodejs/node / validateReadFileAbortLogicDuring

Function validateReadFileAbortLogicDuring

test/parallel/test-fs-promises-readfile.js:52–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50}
51
52function validateReadFileAbortLogicDuring() {
53 const controller = new AbortController();
54 const signal = controller.signal;
55 process.nextTick(() => controller.abort());
56 assert.rejects(readFile(fn, { signal }), {
57 name: 'AbortError'
58 }).then(common.mustCall());
59}
60
61async function validateWrongSignalParam() {
62 // Verify that if something different than Abortcontroller.signal

Callers 1

Calls 3

abortMethod · 0.95
readFileFunction · 0.70
thenMethod · 0.45

Tested by

no test coverage detected