MCPcopy Create free account
hub / github.com/simstudioai/sim / buildMockResponse

Function buildMockResponse

apps/sim/app/api/copilot/api-keys/route.test.ts:33–44  ·  view source on GitHub ↗
(init: {
  ok: boolean
  status?: number
  json: () => Promise<unknown>
})

Source from the content-addressed store, hash-verified

31// to stamp span attributes, so mock responses need both fields or the call
32// path throws before the route handler sees the body.
33function buildMockResponse(init: {
34 ok: boolean
35 status?: number
36 json: () => Promise<unknown>
37}): Record<string, unknown> {
38 return {
39 ok: init.ok,
40 status: init.status ?? (init.ok ? 200 : 500),
41 headers: new Headers(),
42 json: init.json,
43 }
44}
45
46describe('Copilot API Keys API Route', () => {
47 beforeEach(() => {

Callers 1

route.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected