()
| 208 | // ============================================================================= |
| 209 | |
| 210 | async function testLargeDataAsync() { |
| 211 | const totalSize = 1024 * 1024; // 1 MB |
| 212 | const chunkSize = 16384; |
| 213 | |
| 214 | async function* gen() { |
| 215 | let remaining = totalSize; |
| 216 | while (remaining > 0) { |
| 217 | const size = Math.min(chunkSize, remaining); |
| 218 | yield [Buffer.alloc(size, 0x42)]; // Fill with 'B' |
| 219 | remaining -= size; |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | const readable = toReadable(gen()); |
| 224 | const result = await collect(readable); |
| 225 | assert.strictEqual(result.length, totalSize); |
| 226 | assert.strictEqual(result[0], 0x42); |
| 227 | assert.strictEqual(result[totalSize - 1], 0x42); |
| 228 | } |
| 229 | |
| 230 | // ============================================================================= |
| 231 | // fromStreamIter: pipe to Writable |
no test coverage detected