MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / autumnAnswers

Function autumnAnswers

apps/cloud/src/auth/v2-import.test.ts:125–134  ·  view source on GitHub ↗
(answer: () => Response | Promise<Response>)

Source from the content-addressed store, hash-verified

123
124 /** Autumn answering every request with `answer`, recording each request. */
125 const autumnAnswers = (answer: () => Response | Promise<Response>) => {
126 globalThis.fetch = (async (input: RequestInfo | URL, init?: RequestInit) => {
127 requests.push({
128 url: String(input),
129 method: init?.method ?? "GET",
130 body: String(init?.body),
131 });
132 return answer();
133 }) as typeof fetch;
134 };
135 const customer = (subscriptions: ReadonlyArray<{ plan_id: string; status: string }>) =>
136 Response.json({ id: ORG, name: null, balances: {}, subscriptions, purchases: [] });
137

Callers 1

v2-import.test.tsFile · 0.85

Calls 2

pushMethod · 0.80
answerFunction · 0.70

Tested by

no test coverage detected