MCPcopy Create free account
hub / github.com/TanStack/ai / createMockStream

Function createMockStream

packages/ai/tests/stream-to-response.test.ts:10–16  ·  view source on GitHub ↗
(
  chunks: Array<Record<string, unknown>>,
)

Source from the content-addressed store, hash-verified

8
9// Helper to create mock async iterable
10async function* createMockStream(
11 chunks: Array<Record<string, unknown>>,
12): AsyncGenerator<StreamChunk> {
13 for (const chunk of chunks) {
14 yield chunk as StreamChunk
15 }
16}
17
18// Helper to read ReadableStream
19async function readStream(stream: ReadableStream<Uint8Array>): Promise<string> {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected