MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / createMockDb

Function createMockDb

packages/core/src/import/__tests__/writers.test.ts:6–18  ·  view source on GitHub ↗
(members: Array<{ id: number; platform_id: string }>)

Source from the content-addressed store, hash-verified

4import type { DatabaseAdapter } from '../../interfaces'
5
6function createMockDb(members: Array<{ id: number; platform_id: string }>): DatabaseAdapter {
7 return {
8 prepare: (_sql: string) => ({
9 all: () => [...members],
10 get: () => undefined,
11 run: () => ({ changes: 0 }),
12 }),
13 exec: () => {},
14 transaction: <T>(fn: () => T) => fn(),
15 pragma: () => undefined,
16 close: () => {},
17 }
18}
19
20describe('buildMemberIdMap', () => {
21 it('returns empty map for empty member table', () => {

Callers 1

writers.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected