MCPcopy Create free account
hub / github.com/TanStack/db / createTestProducts

Function createTestProducts

packages/powersync-db-collection/tests/load-hooks.test.ts:35–45  ·  view source on GitHub ↗
(db: PowerSyncDatabase)

Source from the content-addressed store, hash-verified

33 }
34
35 async function createTestProducts(db: PowerSyncDatabase) {
36 await db.execute(`
37 INSERT INTO products (id, name, price, category)
38 VALUES
39 (uuid(), 'Product A', 50, 'electronics'),
40 (uuid(), 'Product B', 150, 'electronics'),
41 (uuid(), 'Product C', 25, 'clothing'),
42 (uuid(), 'Product D', 200, 'electronics'),
43 (uuid(), 'Product E', 75, 'clothing')
44 `)
45 }
46
47 it(`eager mode: should call onLoad on sync start and onUnload on cleanup`, async () => {
48 const db = await createDatabase()

Callers 1

load-hooks.test.tsFile · 0.70

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected