MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / recordingFetch

Function recordingFetch

graph-ui/src/app/atlas-api.test.ts:17–30  ·  view source on GitHub ↗
(
    reply: { ok?: boolean; status?: number; body: string },
    calls: FetchCall[],
)

Source from the content-addressed store, hash-verified

15}
16
17function recordingFetch(
18 reply: { ok?: boolean; status?: number; body: string },
19 calls: FetchCall[],
20): typeof globalThis.fetch {
21 return ((url: string, init?: RequestInit) => {
22 calls.push({ url, init });
23 return Promise.resolve({
24 ok: reply.ok ?? true,
25 status: reply.status ?? 200,
26 statusText: '',
27 text: () => Promise.resolve(reply.body),
28 });
29 }) as unknown as typeof globalThis.fetch;
30}
31
32function api(reply: { ok?: boolean; status?: number; body: string }): { api: AtlasApi; calls: FetchCall[] } {
33 const calls: FetchCall[] = [];

Callers 2

apiFunction · 0.70
atlas-api.test.tsFile · 0.70

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected