()
| 21 | |
| 22 | /** Check the status of services which Angular caretakers need to monitor. */ |
| 23 | export async function checkServiceStatuses() { |
| 24 | /** The configuration for the caretaker commands. */ |
| 25 | const config = await getConfig(); |
| 26 | assertValidCaretakerConfig(config); |
| 27 | assertValidGithubConfig(config); |
| 28 | |
| 29 | /** An authenticated git client instance. */ |
| 30 | const git = await AuthenticatedGitClient.get(); |
| 31 | |
| 32 | /** List of instances of Caretaker Check modules */ |
| 33 | const caretakerCheckModules = moduleList.map((module) => new module(git, config)); |
| 34 | |
| 35 | // Module's `data` is casted as Promise<unknown> because the data types of the `module`'s `data` |
| 36 | // promises do not match typings, however our usage here is only to determine when the promise |
| 37 | // resolves. |
| 38 | await Promise.all(caretakerCheckModules.map((module) => module.data as Promise<unknown>)); |
| 39 | |
| 40 | for (const module of caretakerCheckModules) { |
| 41 | await module.printToTerminal(); |
| 42 | } |
| 43 | } |
no test coverage detected