()
| 86 | |
| 87 | // PipeTo with AbortSignal |
| 88 | async function testPipeToWithSignal() { |
| 89 | const ac = new AbortController(); |
| 90 | const chunks = []; |
| 91 | const writer = { |
| 92 | write(chunk) { chunks.push(chunk); }, |
| 93 | }; |
| 94 | async function* slowSource() { |
| 95 | yield [new TextEncoder().encode('a')]; |
| 96 | await new Promise((r) => setTimeout(r, 50)); |
| 97 | yield [new TextEncoder().encode('b')]; |
| 98 | } |
| 99 | ac.abort(); |
| 100 | await assert.rejects( |
| 101 | () => pipeTo(slowSource(), writer, { signal: ac.signal }), |
| 102 | { name: 'AbortError' }, |
| 103 | ); |
| 104 | } |
| 105 | |
| 106 | // PipeTo with transforms |
| 107 | async function testPipeToWithTransforms() { |
no test coverage detected
searching dependent graphs…