MCPcopy Create free account
hub / github.com/simstudioai/sim / createMockStream

Function createMockStream

apps/sim/app/api/chat/[identifier]/route.test.ts:50–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48}
49
50const createMockStream = () => {
51 return new ReadableStream({
52 start(controller) {
53 controller.enqueue(
54 new TextEncoder().encode('data: {"blockId":"agent-1","chunk":"Hello"}\n\n')
55 )
56 controller.enqueue(
57 new TextEncoder().encode('data: {"blockId":"agent-1","chunk":" world"}\n\n')
58 )
59 controller.enqueue(
60 new TextEncoder().encode('data: {"event":"final","data":{"success":true}}\n\n')
61 )
62 controller.close()
63 },
64 })
65}
66
67const {
68 mockValidateChatAuth,

Callers 1

route.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected