(stream)
| 19 | } |
| 20 | |
| 21 | function readStream(stream) { |
| 22 | return new Promise((resolve, reject) => { |
| 23 | let data = ''; |
| 24 | stream.on('data', (chunk) => { |
| 25 | data += chunk; |
| 26 | }); |
| 27 | stream.on('end', () => { |
| 28 | resolve(data); |
| 29 | }); |
| 30 | stream.on('error', reject); |
| 31 | }); |
| 32 | } |
| 33 | |
| 34 | function tapStream(originalStream, onData) { |
| 35 | const tee = new PassThrough(); |
no outgoing calls
no test coverage detected