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

Function runFrontCase

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

Source from the content-addressed store, hash-verified

202 // The front Worker answers the same requests the same way: everything the
203 // contract forwards reaches v2 once, and nothing else reaches it.
204 const runFrontCase = async (method: string, target: string) => {
205 const calls: Request[] = [];
206 const v2: V2Service = {
207 fetch: (request) => {
208 calls.push(request);
209 return Promise.resolve(new Response("v2"));
210 },
211 };
212 const request = new Request(`${contract.origin}${target}`, { method });
213 const response = await frontResponse(request, { ...frontShipped, V2: v2 });
214 return { request, calls, response };
215 };
216
217 for (const { method, target } of forwarded) {
218 it(`front Worker forwards ${method} ${target} to v2`, async () => {

Callers 1

Calls 3

frontResponseFunction · 0.90
pushMethod · 0.80
resolveMethod · 0.80

Tested by

no test coverage detected