()
| 42 | } |
| 43 | |
| 44 | async function testTapAsync() { |
| 45 | const observed = []; |
| 46 | const observer = tap(async (chunks) => { |
| 47 | if (chunks !== null) { |
| 48 | observed.push(chunks.length); |
| 49 | } |
| 50 | }); |
| 51 | |
| 52 | assert.strictEqual(typeof observer, 'function'); |
| 53 | |
| 54 | const input = [new Uint8Array([1])]; |
| 55 | const result = await observer(input); |
| 56 | assert.deepStrictEqual(result, input); |
| 57 | assert.deepStrictEqual(observed, [1]); |
| 58 | } |
| 59 | |
| 60 | async function testTapInPipeline() { |
| 61 | const { writer, readable } = push(); |
no test coverage detected