| 59 | } |
| 60 | |
| 61 | async 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 | |
| 77 | async function testCancelledWriteRemovedFromQueue() { |
| 78 | const { writer, readable } = push({ highWaterMark: 1 }); |