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

Function mockProcessingCounts

apps/sim/app/api/schedules/execute/route.test.ts:222–236  ·  view source on GitHub ↗
(...counts: number[])

Source from the content-addressed store, hash-verified

220}
221
222function mockProcessingCounts(...counts: number[]) {
223 const defaultWhere = dbChainMockFns.where.getMockImplementation()
224 if (!defaultWhere) throw new Error('Expected default where mock implementation')
225 let index = 0
226
227 dbChainMockFns.where.mockImplementation((condition: unknown) => {
228 if (isActiveScheduleExecutionCountCondition(condition) && index < counts.length) {
229 const count = counts[index]
230 index += 1
231 return Promise.resolve([{ count }]) as ReturnType<typeof dbChainMockFns.where>
232 }
233
234 return defaultWhere(condition)
235 })
236}
237
238function createMockRequest(): NextRequest {
239 const mockHeaders = new Map([

Callers 1

route.test.tsFile · 0.85

Calls 2

resolveMethod · 0.65

Tested by

no test coverage detected