()
| 110 | } |
| 111 | |
| 112 | async function testAbortSignal() { |
| 113 | const ac = new AbortController(); |
| 114 | const [channelA] = duplex({ signal: ac.signal }); |
| 115 | |
| 116 | ac.abort(); |
| 117 | |
| 118 | // Both directions should error |
| 119 | await assert.rejects( |
| 120 | async () => { |
| 121 | // eslint-disable-next-line no-unused-vars |
| 122 | for await (const _ of channelA.readable) { |
| 123 | assert.fail('Should not reach here'); |
| 124 | } |
| 125 | }, |
| 126 | (err) => err.name === 'AbortError', |
| 127 | ); |
| 128 | } |
| 129 | |
| 130 | async function testEmptyDuplex() { |
| 131 | const [channelA, channelB] = duplex(); |
no test coverage detected
searching dependent graphs…