({ reqPath, body })
| 66 | srv.actualPort = port; |
| 67 | |
| 68 | const call = ({ reqPath, body }) => new Promise((resolve, reject) => { |
| 69 | const req = http.request({ host: '127.0.0.1', port, path: reqPath, method: 'POST', |
| 70 | headers: { 'content-type': 'application/json', authorization: 'Bearer aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'x-goog-api-key': 'client-key', 'user-agent': 'google-genai-sdk/1.0' } }, (res) => { |
| 71 | const chunks = []; |
| 72 | res.on('data', (d) => chunks.push(d)); |
| 73 | res.on('end', () => resolve({ status: res.statusCode, bytes: Buffer.concat(chunks) })); |
| 74 | }); |
| 75 | req.on('error', reject); |
| 76 | req.end(JSON.stringify(body)); |
| 77 | }); |
| 78 | |
| 79 | const readRows = async (expected = 2) => { |
| 80 | let lines = []; |
no outgoing calls
no test coverage detected