()
| 6 | const { push, ondrain, text } = require('stream/iter'); |
| 7 | |
| 8 | async function testOndrain() { |
| 9 | const { writer } = push({ highWaterMark: 1 }); |
| 10 | |
| 11 | // With space available, ondrain resolves immediately |
| 12 | const drainResult = ondrain(writer); |
| 13 | assert.ok(drainResult instanceof Promise); |
| 14 | const result = await drainResult; |
| 15 | assert.strictEqual(result, true); |
| 16 | |
| 17 | // After close, ondrain returns null |
| 18 | writer.end(); |
| 19 | assert.strictEqual(ondrain(writer), null); |
| 20 | } |
| 21 | |
| 22 | async function testOndrainNonDrainable() { |
| 23 | // Non-drainable objects return null |
no test coverage detected