MCPcopy
hub / github.com/callstack/agent-device / readJsonBody

Function readJsonBody

test/integration/smoke-open-remote-config.test.ts:97–104  ·  view source on GitHub ↗
(req: http.IncomingMessage)

Source from the content-addressed store, hash-verified

95}
96
97async function readJsonBody(req: http.IncomingMessage): Promise<any> {
98 const chunks: Buffer[] = [];
99 for await (const chunk of req) {
100 chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
101 }
102 const body = Buffer.concat(chunks).toString('utf8');
103 return body ? JSON.parse(body) : {};
104}
105
106test('connect prepares Metro and open reuses bridged runtime for remote daemon', async (t) => {
107 if (await skipWhenLoopbackUnavailable(t, 'remote open smoke coverage')) {

Calls 2

pushMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected