()
| 232 | // ============================================================================= |
| 233 | |
| 234 | async function testPipeAsync() { |
| 235 | const source = from('pipe test data'); |
| 236 | const readable = toReadable(source); |
| 237 | |
| 238 | const chunks = []; |
| 239 | const writable = new Writable({ |
| 240 | write(chunk, enc, cb) { |
| 241 | chunks.push(chunk); |
| 242 | cb(); |
| 243 | }, |
| 244 | }); |
| 245 | |
| 246 | await new Promise((resolve, reject) => { |
| 247 | readable.pipe(writable); |
| 248 | writable.on('finish', resolve); |
| 249 | writable.on('error', reject); |
| 250 | }); |
| 251 | |
| 252 | assert.strictEqual(Buffer.concat(chunks).toString(), 'pipe test data'); |
| 253 | } |
| 254 | |
| 255 | // ============================================================================= |
| 256 | // fromStreamIter: not object mode |
no test coverage detected