()
| 421 | // ============================================================================= |
| 422 | |
| 423 | async function testBackpressureSync() { |
| 424 | function* gen() { |
| 425 | for (let i = 0; i < 10; i++) { |
| 426 | yield [Buffer.from(`s${i}`)]; |
| 427 | } |
| 428 | } |
| 429 | |
| 430 | const readable = toReadableSync(gen(), { highWaterMark: 1 }); |
| 431 | |
| 432 | const chunks = []; |
| 433 | for await (const chunk of readable) { |
| 434 | chunks.push(chunk); |
| 435 | } |
| 436 | |
| 437 | assert.strictEqual(chunks.length, 10); |
| 438 | } |
| 439 | |
| 440 | // ============================================================================= |
| 441 | // fromStreamIterSync: backpressure within a batch |
no test coverage detected