* Builds a fake stream factory mirroring the providers' `createReadableStreamFrom*` * helpers: it returns a sentinel stream and synchronously invokes the drain * callback so the test can assert the populated output without a real stream.
(
drain: (handles: { output: NormalizedBlockOutput; finalizeTiming: () => void }) => void
)
| 11 | * callback so the test can assert the populated output without a real stream. |
| 12 | */ |
| 13 | function fakeStreamFactory( |
| 14 | drain: (handles: { output: NormalizedBlockOutput; finalizeTiming: () => void }) => void |
| 15 | ) { |
| 16 | const stream = new ReadableStream() |
| 17 | return { |
| 18 | stream, |
| 19 | createStream: (handles: { output: NormalizedBlockOutput; finalizeTiming: () => void }) => { |
| 20 | drain(handles) |
| 21 | return stream |
| 22 | }, |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | describe('createStreamingExecution', () => { |
| 27 | const providerStartTime = 1_000 |
no outgoing calls
no test coverage detected