(server: http.Server)
| 91 | }); |
| 92 | |
| 93 | export function getServerURL(server: http.Server): string { |
| 94 | const address = server.address(); |
| 95 | if (address && typeof address !== 'string') { |
| 96 | return `http://localhost:${address.port}`; |
| 97 | } else { |
| 98 | return `${address}`; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * Puppeteer may cast random mouse move which make our tests flaky. |