()
| 63 | // ============================================================================= |
| 64 | |
| 65 | async function testWriteNoDrain() { |
| 66 | const chunks = []; |
| 67 | const writable = new Writable({ |
| 68 | highWaterMark: 1024, |
| 69 | write(chunk, encoding, cb) { |
| 70 | chunks.push(Buffer.from(chunk)); |
| 71 | cb(); |
| 72 | }, |
| 73 | }); |
| 74 | |
| 75 | const writer = fromWritable(writable); |
| 76 | await writer.write('hello'); |
| 77 | await writer.write(' world'); |
| 78 | await writer.end(); |
| 79 | |
| 80 | assert.strictEqual(Buffer.concat(chunks).toString(), 'hello world'); |
| 81 | } |
| 82 | |
| 83 | // ============================================================================= |
| 84 | // block: write() waits for drain when backpressure is active |
no test coverage detected