()
| 370 | // ============================================================================= |
| 371 | |
| 372 | async function testWithTransformAsync() { |
| 373 | // Uppercase transform |
| 374 | function upper(chunks) { |
| 375 | if (chunks === null) return null; |
| 376 | return chunks.map((c) => { |
| 377 | const buf = Buffer.from(c); |
| 378 | for (let i = 0; i < buf.length; i++) { |
| 379 | if (buf[i] >= 97 && buf[i] <= 122) buf[i] -= 32; |
| 380 | } |
| 381 | return buf; |
| 382 | }); |
| 383 | } |
| 384 | |
| 385 | const source = pull(from('hello world'), upper); |
| 386 | const readable = toReadable(source); |
| 387 | const result = await collect(readable); |
| 388 | assert.strictEqual(result.toString(), 'HELLO WORLD'); |
| 389 | } |
| 390 | |
| 391 | // ============================================================================= |
| 392 | // fromStreamIterSync: basic sync round-trip |
no test coverage detected