(log: (message: string) => void = console.log)
| 226 | * what fails a run; this makes a narrowed run legible. |
| 227 | */ |
| 228 | export function createProjectCountReporter(log: (message: string) => void = console.log) { |
| 229 | let registered: string[] = []; |
| 230 | return { |
| 231 | onInit(context: ProjectCountReporterContext) { |
| 232 | registered = context.projects.map((project) => project.name); |
| 233 | }, |
| 234 | onTestRunEnd(testModules: readonly ProjectCountReporterModule[]) { |
| 235 | const counts = new Map<string, number>(); |
| 236 | for (const testModule of testModules) { |
| 237 | const name = testModule.project.name; |
| 238 | counts.set(name, (counts.get(name) ?? 0) + 1); |
| 239 | } |
| 240 | log(formatProjectRunSummary(registered, counts)); |
| 241 | }, |
| 242 | }; |
| 243 | } |
no outgoing calls
no test coverage detected