| 1 | import { Readable } from 'node:stream'; |
| 2 | |
| 3 | export class MockReadable extends Readable { |
| 4 | protected _buffer: unknown[] | null = []; |
| 5 | |
| 6 | _read() { |
| 7 | if (this._buffer === null) { |
| 8 | this.push(null); |
| 9 | return; |
| 10 | } |
| 11 | |
| 12 | for (const val of this._buffer) { |
| 13 | this.push(val); |
| 14 | } |
| 15 | |
| 16 | this._buffer = []; |
| 17 | } |
| 18 | |
| 19 | pushValue(val: unknown): void { |
| 20 | this._buffer?.push(val); |
| 21 | } |
| 22 | |
| 23 | close(): void { |
| 24 | this._buffer = null; |
| 25 | } |
| 26 | } |
nothing calls this directly
no outgoing calls
no test coverage detected