MCPcopy
hub / github.com/simstudioai/sim / queueWhereResponses

Function queueWhereResponses

apps/sim/lib/invitations/core.test.ts:77–93  ·  view source on GitHub ↗
(responses: unknown[][])

Source from the content-addressed store, hash-verified

75import { acceptInvitation } from '@/lib/invitations/core'
76
77function queueWhereResponses(responses: unknown[][]) {
78 const queue = [...responses]
79 dbChainMockFns.where.mockImplementation(() => {
80 const result = queue.shift() ?? []
81 const thenable = Promise.resolve(result) as Promise<unknown[]> & {
82 limit: ReturnType<typeof vi.fn>
83 orderBy: ReturnType<typeof vi.fn>
84 returning: ReturnType<typeof vi.fn>
85 groupBy: ReturnType<typeof vi.fn>
86 }
87 thenable.limit = vi.fn(() => Promise.resolve(result))
88 thenable.orderBy = vi.fn(() => Promise.resolve(result))
89 thenable.returning = vi.fn(() => Promise.resolve(result))
90 thenable.groupBy = vi.fn(() => Promise.resolve(result))
91 return thenable as ReturnType<typeof dbChainMockFns.where>
92 })
93}
94
95describe('acceptInvitation', () => {
96 beforeEach(() => {

Callers 1

core.test.tsFile · 0.70

Calls 2

shiftMethod · 0.80
resolveMethod · 0.65

Tested by

no test coverage detected