MCPcopy
hub / github.com/simstudioai/sim / readAllChunks

Function readAllChunks

apps/sim/app/api/copilot/chat/stream/route.test.ts:51–64  ·  view source on GitHub ↗
(response: Response)

Source from the content-addressed store, hash-verified

49import { GET } from './route'
50
51async 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
66describe('copilot chat stream replay route', () => {
67 beforeEach(() => {

Callers 1

route.test.tsFile · 0.85

Calls 2

readMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected