(options)
| 348 | } |
| 349 | |
| 350 | async function waitForApp(options) { |
| 351 | const deadline = Date.now() + options.launchTimeoutSeconds * 1000; |
| 352 | |
| 353 | while (Date.now() < deadline) { |
| 354 | const app = findCapMainProcess(readProcesses(), options.appCommandPrefix); |
| 355 | |
| 356 | if (app) return app; |
| 357 | |
| 358 | await sleep(500); |
| 359 | } |
| 360 | |
| 361 | throw new Error( |
| 362 | `Cap did not launch within ${options.launchTimeoutSeconds} seconds: ${options.appCommandPrefix}`, |
| 363 | ); |
| 364 | } |
| 365 | |
| 366 | async function waitForAppExit(child, timeoutSeconds) { |
| 367 | const deadline = Date.now() + timeoutSeconds * 1000; |
no test coverage detected