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

Function testWriteWithPreAbortedSignal

test/parallel/test-stream-iter-push-writer.js:61–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59}
60
61async function testWriteWithPreAbortedSignal() {
62 const { writer, readable } = push({ highWaterMark: 1 });
63
64 // Pre-aborted signal should reject immediately
65 await assert.rejects(
66 writer.write('data', { signal: AbortSignal.abort() }),
67 { name: 'AbortError' },
68 );
69
70 // Writer should still be usable for other writes
71 writer.write('ok');
72 writer.end();
73 const data = await text(readable);
74 assert.strictEqual(data, 'ok');
75}
76
77async function testCancelledWriteRemovedFromQueue() {
78 const { writer, readable } = push({ highWaterMark: 1 });

Callers 1

Calls 5

pushFunction · 0.70
abortMethod · 0.65
textFunction · 0.50
writeMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…