(url)
| 147 | } |
| 148 | |
| 149 | function httpGet(url) { |
| 150 | return new Promise((res, rej) => { |
| 151 | const req = request(url, (r) => { |
| 152 | let body = ""; |
| 153 | r.setEncoding("utf8"); |
| 154 | r.on("data", (c) => { |
| 155 | body += c; |
| 156 | }); |
| 157 | r.on("end", () => res({ statusCode: r.statusCode ?? 0, body })); |
| 158 | }); |
| 159 | req.once("error", rej); |
| 160 | req.end(); |
| 161 | }); |
| 162 | } |
| 163 | |
| 164 | async function waitForHealth(port, child, deadlineMs = 5000) { |
| 165 | const started = Date.now(); |
no test coverage detected