()
| 44 | // ============================================================================= |
| 45 | |
| 46 | async function testMultiBatchAsync() { |
| 47 | async function* gen() { |
| 48 | for (let i = 0; i < 5; i++) { |
| 49 | const batch = []; |
| 50 | for (let j = 0; j < 3; j++) { |
| 51 | batch.push(Buffer.from(`${i}-${j} `)); |
| 52 | } |
| 53 | yield batch; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | const readable = toReadable(gen()); |
| 58 | const result = await collect(readable); |
| 59 | assert.strictEqual(result.toString(), |
| 60 | '0-0 0-1 0-2 1-0 1-1 1-2 2-0 2-1 2-2 3-0 3-1 3-2 4-0 4-1 4-2 '); |
| 61 | } |
| 62 | |
| 63 | // ============================================================================= |
| 64 | // fromStreamIter: backpressure with small highWaterMark |
no test coverage detected