()
| 133 | // ============================================================================= |
| 134 | |
| 135 | async function testDelayedPushes() { |
| 136 | let pushCount = 0; |
| 137 | const readable = new Readable({ |
| 138 | read() { |
| 139 | if (pushCount < 3) { |
| 140 | setTimeout(() => { |
| 141 | this.push(Buffer.from(`delayed${pushCount}`)); |
| 142 | pushCount++; |
| 143 | if (pushCount === 3) { |
| 144 | this.push(null); |
| 145 | } |
| 146 | }, 10); |
| 147 | } |
| 148 | }, |
| 149 | }); |
| 150 | |
| 151 | const result = await text(from(readable)); |
| 152 | assert.strictEqual(result, 'delayed0delayed1delayed2'); |
| 153 | } |
| 154 | |
| 155 | // ============================================================================= |
| 156 | // Byte-mode Readable: empty stream |
no test coverage detected