()
| 154 | |
| 155 | // Abort signal affects both channels |
| 156 | async function testAbortSignalBothChannels() { |
| 157 | const ac = new AbortController(); |
| 158 | const [channelA, channelB] = duplex({ signal: ac.signal }); |
| 159 | |
| 160 | ac.abort(); |
| 161 | |
| 162 | await assert.rejects(async () => { |
| 163 | // eslint-disable-next-line no-unused-vars |
| 164 | for await (const _ of channelA.readable) { |
| 165 | assert.fail('Should not reach here'); |
| 166 | } |
| 167 | }, (err) => err.name === 'AbortError'); |
| 168 | |
| 169 | await assert.rejects(async () => { |
| 170 | // eslint-disable-next-line no-unused-vars |
| 171 | for await (const _ of channelB.readable) { |
| 172 | assert.fail('Should not reach here'); |
| 173 | } |
| 174 | }, (err) => err.name === 'AbortError'); |
| 175 | } |
| 176 | |
| 177 | Promise.all([ |
| 178 | testBasicDuplex(), |
no test coverage detected
searching dependent graphs…