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

Function mockResponse

apps/sim/tools/agiloft/utils.server.test.ts:26–37  ·  view source on GitHub ↗
(body: { ok?: boolean; status?: number; json?: unknown; text?: string })

Source from the content-addressed store, hash-verified

24}
25
26function mockResponse(body: { ok?: boolean; status?: number; json?: unknown; text?: string }) {
27 return {
28 ok: body.ok ?? true,
29 status: body.status ?? 200,
30 statusText: '',
31 headers: { get: () => null, getSetCookie: () => [], toRecord: () => ({}) },
32 body: null,
33 text: async () => body.text ?? '',
34 json: async () => body.json ?? {},
35 arrayBuffer: async () => new ArrayBuffer(0),
36 }
37}
38
39beforeEach(() => {
40 mockValidateUrlWithDNS.mockReset()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected