(url: string)
| 90 | }) |
| 91 | |
| 92 | const fetchTextWithRetry = async (url: string) => { |
| 93 | let lastError: unknown |
| 94 | |
| 95 | for (let attempt = 0; attempt < 10; attempt += 1) { |
| 96 | try { |
| 97 | const response = await fetch(url) |
| 98 | return response.text() |
| 99 | } |
| 100 | catch (error) { |
| 101 | lastError = error |
| 102 | await new Promise(resolve => setTimeout(resolve, 50)) |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | throw lastError |
| 107 | } |
| 108 | |
| 109 | const spawnCli = (args: readonly string[], cwd: string) => { |
| 110 | const child = spawn(process.execPath, [binPath, ...args], { |
no test coverage detected