MCPcopy
hub / github.com/TanStack/ai / createMockConnection

Function createMockConnection

packages/ai-client/tests/generation-client.test.ts:8–18  ·  view source on GitHub ↗
(
  chunks: Array<StreamChunk>,
)

Source from the content-addressed store, hash-verified

6
7// Helper to create a mock connect-based adapter from StreamChunks
8function createMockConnection(
9 chunks: Array<StreamChunk>,
10): ConnectConnectionAdapter {
11 return {
12 async *connect() {
13 for (const chunk of chunks) {
14 yield chunk
15 }
16 },
17 }
18}
19
20describe('GenerationClient', () => {
21 describe('fetcher mode', () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected