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

Function mockActiveVersionSelect

apps/sim/lib/workflows/persistence/utils.test.ts:1624–1634  ·  view source on GitHub ↗

* Wires `db.select` to return a single active deployment-version row for the * given id. Returns the inner `where` spy so tests can assert how many times * the active-version SELECT ran.

(versionId: string, state: unknown)

Source from the content-addressed store, hash-verified

1622 * the active-version SELECT ran.
1623 */
1624 function mockActiveVersionSelect(versionId: string, state: unknown) {
1625 const where = vi.fn().mockReturnValue({
1626 orderBy: vi.fn().mockReturnValue({
1627 limit: vi.fn().mockResolvedValue([{ id: versionId, state, createdAt: new Date() }]),
1628 }),
1629 })
1630 mockDb.select.mockReturnValue({
1631 from: vi.fn().mockReturnValue({ where }),
1632 })
1633 return where
1634 }
1635
1636 beforeEach(() => {
1637 vi.clearAllMocks()

Callers 1

utils.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected