(response: Response)
| 49 | import { GET } from './route' |
| 50 | |
| 51 | async function readAllChunks(response: Response): Promise<string[]> { |
| 52 | const reader = response.body?.getReader() |
| 53 | expect(reader).toBeTruthy() |
| 54 | |
| 55 | const chunks: string[] = [] |
| 56 | while (true) { |
| 57 | const { done, value } = await reader!.read() |
| 58 | if (done) { |
| 59 | break |
| 60 | } |
| 61 | chunks.push(new TextDecoder().decode(value)) |
| 62 | } |
| 63 | return chunks |
| 64 | } |
| 65 | |
| 66 | describe('copilot chat stream replay route', () => { |
| 67 | beforeEach(() => { |
no test coverage detected