( instance: RenderResult, timeoutMs: number = 20_000 )
| 245 | new Promise((resolve) => setTimeout(resolve, ms)); |
| 246 | |
| 247 | export const waitForExit = async ( |
| 248 | instance: RenderResult, |
| 249 | timeoutMs: number = 20_000 |
| 250 | ): Promise<number> => { |
| 251 | const startedAt = Date.now(); |
| 252 | |
| 253 | while (Date.now() - startedAt < timeoutMs) { |
| 254 | const exit = instance.hasExit(); |
| 255 | if (exit) { |
| 256 | return exit.exitCode; |
| 257 | } |
| 258 | await wait(25); |
| 259 | } |
| 260 | |
| 261 | throw new Error('Process did not exit within the expected timeout'); |
| 262 | }; |
| 263 | |
| 264 | export const getHeadCommitSubject = async (gitDir: string): Promise<string> => { |
| 265 | const { stdout } = await runGit(['log', '-1', '--pretty=%s'], gitDir); |
no test coverage detected
searching dependent graphs…