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

Function startTestServer

apps/local/src/serve.test.ts:37–48  ·  view source on GitHub ↗
(
  opts: { authToken?: string; hostname?: string } = {},
)

Source from the content-addressed store, hash-verified

35});
36
37const startTestServer = async (
38 opts: { authToken?: string; hostname?: string } = {},
39): Promise<string> => {
40 server = await startServer({
41 port: 0,
42 hostname: opts.hostname ?? "127.0.0.1",
43 clientDir,
44 authToken: opts.authToken ?? TOKEN,
45 handlers: testHandlers(),
46 });
47 return `http://127.0.0.1:${server.port}`;
48};
49
50beforeEach(() => {
51 clientDir = mkdtempSync(join(tmpdir(), "exec-local-serve-"));

Callers 1

serve.test.tsFile · 0.85

Calls 2

startServerFunction · 0.90
testHandlersFunction · 0.85

Tested by

no test coverage detected