MCPcopy Index your code
hub / github.com/TanStack/db / createMockCollection

Function createMockCollection

packages/db/tests/apply-mutations.test.ts:7–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5describe(`applyMutations merge logic`, () => {
6 // Create a shared collection for all tests
7 const createMockCollection = () =>
8 createCollection<{
9 id: string
10 name: string
11 value?: number
12 }>({
13 id: `test-collection`,
14 getKey: (item) => item.id,
15 onInsert: async () => {}, // Add required handler
16 onUpdate: async () => {}, // Add required handler
17 onDelete: async () => {}, // Add required handler
18 sync: {
19 sync: () => {},
20 },
21 })
22
23 it(`should merge update after insert correctly`, () => {
24 const transaction = createTransaction({

Callers 1

Calls 1

createCollectionFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…