MCPcopy Create free account
hub / github.com/EvoMap/evolver / call

Function call

test/proxyClientsE2E.test.js:77–86  ·  view source on GitHub ↗
({ path: reqPath = '/v1/messages', headers, body })

Source from the content-addressed store, hash-verified

75 srv.actualPort = port;
76
77 const call = ({ path: reqPath = '/v1/messages', headers, body }) => new Promise((resolve, reject) => {
78 const req = http.request({ host: '127.0.0.1', port, path: reqPath, method: 'POST',
79 headers: { 'content-type': 'application/json', authorization: 'Bearer aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'x-api-key': 'sk-client', ...headers } }, (res) => {
80 const chunks = [];
81 res.on('data', (d) => chunks.push(d));
82 res.on('end', () => resolve({ status: res.statusCode, bytes: Buffer.concat(chunks) }));
83 });
84 req.on('error', reject);
85 req.end(JSON.stringify(body));
86 });
87
88 // Each test issues a non-stream + a stream call; the streamed row emits only once its SSE body is drained,
89 // so wait for the expected count (not just the first line) before asserting.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected