* @param {string} baseUrl * @returns {Promise }
(baseUrl)
| 96 | * @returns {Promise<void>} |
| 97 | */ |
| 98 | async function waitForServer (baseUrl) { |
| 99 | const { hostname, port, protocol } = new URL(baseUrl) |
| 100 | const deadline = Date.now() + 30_000 |
| 101 | |
| 102 | while (Date.now() < deadline) { |
| 103 | if (await canConnect(hostname, Number(port), protocol)) { |
| 104 | return |
| 105 | } |
| 106 | |
| 107 | await sleep(250) |
| 108 | } |
| 109 | |
| 110 | throw new Error(`cache test server did not start listening at ${baseUrl}`) |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * @param {string} host |
no test coverage detected
searching dependent graphs…