MCPcopy Index your code
hub / github.com/simstudioai/sim / makeTx

Function makeTx

apps/sim/lib/workspaces/fork/promote/rollback.test.ts:71–82  ·  view source on GitHub ↗

A fake transaction whose existence query returns the given undeploy ids.

(existingUndeployIds: string[] = [])

Source from the content-addressed store, hash-verified

69
70/** A fake transaction whose existence query returns the given undeploy ids. */
71function makeTx(existingUndeployIds: string[] = []) {
72 return {
73 select: vi.fn(() => ({
74 from: vi.fn(() => ({
75 where: vi.fn(() => Promise.resolve(existingUndeployIds.map((id) => ({ id })))),
76 })),
77 })),
78 update: vi.fn(() => ({
79 set: vi.fn(() => ({ where: vi.fn(() => Promise.resolve(undefined)) })),
80 })),
81 }
82}
83
84function setTx(existingUndeployIds: string[] = []) {
85 vi.mocked(db.transaction).mockImplementation(

Callers 2

setTxFunction · 0.70
rollback.test.tsFile · 0.70

Calls 1

resolveMethod · 0.65

Tested by

no test coverage detected