(
stream: AsyncGenerator<string>,
)
| 17 | } |
| 18 | |
| 19 | async function streamToString( |
| 20 | stream: AsyncGenerator<string>, |
| 21 | ): Promise<string> { |
| 22 | let result = ""; |
| 23 | for await (const chunk of stream) { |
| 24 | result += chunk; |
| 25 | } |
| 26 | return result; |
| 27 | } |
| 28 | |
| 29 | it("should yield all chunks when maxTimeMs is not reached", async () => { |
| 30 | const mockStream = createMockStream(["Hello", " world", "!"]); |