(options = {})
| 745 | } |
| 746 | |
| 747 | async function waitForHealth(options = {}) { |
| 748 | const deadline = Date.now() + (options.timeoutMs ?? 30_000); |
| 749 | while (Date.now() < deadline) { |
| 750 | try { |
| 751 | const health = await httpJson("GET", "/api/health"); |
| 752 | if (health.httpPort === serverPort) { |
| 753 | return; |
| 754 | } |
| 755 | } catch { |
| 756 | await sleep(250); |
| 757 | } |
| 758 | } |
| 759 | throw new Error("Timed out waiting for SimDeck integration server."); |
| 760 | } |
| 761 | |
| 762 | function simdeckJson(args, options = {}) { |
| 763 | return JSON.parse(simdeckText(args, options)); |
no test coverage detected