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

Function createEmulatorInstance

e2e/src/emulator-instance.ts:8–20  ·  view source on GitHub ↗
(service: string, label = "e2e")

Source from the content-addressed store, hash-verified

6// also keeps ledger assertions free of cross-run pollution. The server
7// generates an unguessable instance name; the label is a readable prefix.
8export const createEmulatorInstance = (service: string, label = "e2e") =>
9 Effect.promise(async () => {
10 const response = await fetch(`https://${service}.emulators.dev/_emulate/instances`, {
11 method: "POST",
12 headers: { "content-type": "application/json" },
13 body: JSON.stringify({ instance: label }),
14 });
15 if (!response.ok) {
16 throw new Error(`${service} emulator instance creation failed: ${response.status}`);
17 }
18 const instance = (await response.json()) as { readonly providerBaseUrl: string };
19 return instance.providerBaseUrl;
20 });

Calls 2

jsonMethod · 0.65
fetchFunction · 0.50

Tested by

no test coverage detected