MCPcopy Index your code
hub / github.com/nodejs/node / doWriteWithCancel

Function doWriteWithCancel

test/parallel/test-fs-promises-writefile.js:134–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

132}
133
134async function doWriteWithCancel() {
135 const controller = new AbortController();
136 const { signal } = controller;
137 process.nextTick(() => controller.abort());
138 await assert.rejects(
139 fsPromises.writeFile(otherDest, buffer, { signal }),
140 { name: 'AbortError' }
141 );
142}
143
144async function doAppend() {
145 await fsPromises.appendFile(dest, buffer2, { flag: null });

Callers 1

Calls 2

abortMethod · 0.95
writeFileMethod · 0.45

Tested by

no test coverage detected