()
| 44 | // ============================================================================= |
| 45 | |
| 46 | async function testBasicWrite() { |
| 47 | const chunks = []; |
| 48 | const writable = new Writable({ |
| 49 | write(chunk, encoding, cb) { |
| 50 | chunks.push(Buffer.from(chunk)); |
| 51 | cb(); |
| 52 | }, |
| 53 | }); |
| 54 | |
| 55 | const writer = fromWritable(writable, { backpressure: 'block' }); |
| 56 | await pipeTo(from('hello world'), writer); |
| 57 | |
| 58 | assert.strictEqual(Buffer.concat(chunks).toString(), 'hello world'); |
| 59 | } |
| 60 | |
| 61 | // ============================================================================= |
| 62 | // write() resolves when no backpressure (strict) |
no test coverage detected
searching dependent graphs…