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

Function runCase

apps/cloud/src/edge/production-config.test.ts:159–170  ·  view source on GitHub ↗
(method: string, target: string)

Source from the content-addressed store, hash-verified

157/** Run one contract case through v1's edge with the shipped settings and a
158 * stand-in for v2's Worker that records every call. */
159const runCase = async (method: string, target: string) => {
160 const calls: Request[] = [];
161 const v2: V2Service = {
162 fetch: (request) => {
163 calls.push(request);
164 return Promise.resolve(new Response("v2"));
165 },
166 };
167 const request = new Request(`${contract.origin}${target}`, { method });
168 const response = await v2EdgeResponse(request, { ...shipped, V2: v2 });
169 return { request, calls, response };
170};
171
172const forwarded = contract.cases.filter((c) => c.forwards);
173const signUps = contract.cases.filter((c) => !c.forwards && SIGN_UP_TARGETS.has(c.target));

Callers 1

Calls 3

v2EdgeResponseFunction · 0.90
pushMethod · 0.80
resolveMethod · 0.80

Tested by

no test coverage detected