()
| 239 | // ============================================================================= |
| 240 | |
| 241 | async function testDropNewestCountsBytes() { |
| 242 | const writable = new Writable({ |
| 243 | highWaterMark: 5, |
| 244 | write(chunk, enc, cb) { |
| 245 | // Never call cb |
| 246 | }, |
| 247 | }); |
| 248 | |
| 249 | const writer = fromWritable(writable, { backpressure: 'drop-newest' }); |
| 250 | |
| 251 | await writer.write('12345'); // 5 bytes, accepted |
| 252 | await writer.write('67890'); // 5 bytes, dropped |
| 253 | |
| 254 | // desiredSize should be 0 (buffer is full) |
| 255 | assert.strictEqual(writer.desiredSize, 0); |
| 256 | } |
| 257 | |
| 258 | // ============================================================================= |
| 259 | // drop-oldest: throws on construction |
no test coverage detected