()
| 138 | |
| 139 | // Pull signal aborted mid-iteration (not pre-aborted) |
| 140 | async function testPullSignalAbortMidIteration() { |
| 141 | const ac = new AbortController(); |
| 142 | const enc = new TextEncoder(); |
| 143 | async function* slowSource() { |
| 144 | yield [enc.encode('a')]; |
| 145 | yield [enc.encode('b')]; |
| 146 | yield [enc.encode('c')]; |
| 147 | } |
| 148 | const result = pull(slowSource(), { signal: ac.signal }); |
| 149 | const iter = result[Symbol.asyncIterator](); |
| 150 | const first = await iter.next(); // Read first batch |
| 151 | assert.strictEqual(first.done, false); |
| 152 | ac.abort(); |
| 153 | await assert.rejects(() => iter.next(), { name: 'AbortError' }); |
| 154 | } |
| 155 | |
| 156 | async function testPullSignalAbortWhileSourceNextPending() { |
| 157 | const source = { |
no test coverage detected