MCPcopy Index your code
hub / github.com/TanStack/ai / createMockPersistence

Function createMockPersistence

packages/ai-client/tests/test-utils.ts:22–30  ·  view source on GitHub ↗
(
  initial?: Array<UIMessage> | null,
)

Source from the content-addressed store, hash-verified

20 * methods via the returned object's `.mock*` helpers for async/error scenarios.
21 */
22export function createMockPersistence(
23 initial?: Array<UIMessage> | null,
24): ChatClientPersistence {
25 return {
26 getItem: vi.fn(() => initial),
27 setItem: vi.fn(),
28 removeItem: vi.fn(),
29 }
30}
31/**
32 * Options for creating a mock connection adapter
33 */

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected