()
| 8 | export const START_JEST_SERVER = Boolean(JSON.parse(process.env.START_JEST_SERVER || 1)) |
| 9 | |
| 10 | export async function isServerHealthy() { |
| 11 | try { |
| 12 | const res = await got.head(`http://localhost:${PORT}/healthz`, { retry: { limit: 0 } }) |
| 13 | return res.statusCode === 200 |
| 14 | } catch (err) { |
| 15 | // This exception is thrown if you can't even connect. |
| 16 | if (err instanceof RequestError) { |
| 17 | return false |
| 18 | } |
| 19 | throw err |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | export function killServer() { |
| 24 | kill(PORT, 'tcp') |
no outgoing calls
no test coverage detected