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

Function createMockStream

packages/ai-gemini/tests/usage-extraction.test.ts:37–48  ·  view source on GitHub ↗
(
  chunks: Array<Record<string, unknown>>,
)

Source from the content-addressed store, hash-verified

35 new GeminiTextAdapter({ apiKey: 'test-key' }, 'gemini-2.5-pro')
36
37function createMockStream(
38 chunks: Array<Record<string, unknown>>,
39): AsyncIterable<Record<string, unknown>> {
40 return {
41 // eslint-disable-next-line @typescript-eslint/require-await
42 async *[Symbol.asyncIterator]() {
43 for (const chunk of chunks) {
44 yield chunk
45 }
46 },
47 }
48}
49
50describe('Gemini usage extraction', () => {
51 beforeEach(() => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected