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

Function testSignalAlreadyAborted

test/parallel/test-stream-iter-to-readable.js:309–323  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

307// =============================================================================
308
309async function testSignalAlreadyAborted() {
310 async function* gen() {
311 yield [Buffer.from('should not reach')];
312 }
313
314 const readable = toReadable(gen(), { signal: AbortSignal.abort() });
315
316 await assert.rejects(async () => {
317 // eslint-disable-next-line no-unused-vars
318 for await (const chunk of readable) {
319 // Should not receive any data
320 }
321 }, { name: 'AbortError' });
322 assert.ok(readable.destroyed);
323}
324
325// =============================================================================
326// fromStreamIter: options validation

Callers 1

Calls 4

toReadableFunction · 0.85
genFunction · 0.70
abortMethod · 0.65
okMethod · 0.45

Tested by

no test coverage detected