(report: Record<CoverageType, FileCoverage[]>)
| 95 | } |
| 96 | |
| 97 | export function logReport(report: Record<CoverageType, FileCoverage[]>): void { |
| 98 | const typesCount = Object.keys(report).length; |
| 99 | logger.info( |
| 100 | `Collected documentation coverage for ${pluralizeToken('type', typesCount)} of ${pluralize('entity', typesCount)}`, |
| 101 | ); |
| 102 | if (!logger.isVerbose()) { |
| 103 | return; |
| 104 | } |
| 105 | |
| 106 | logger.debug( |
| 107 | formatAsciiTable({ |
| 108 | columns: [ |
| 109 | { key: 'type', label: 'Entity', align: 'left' }, |
| 110 | { key: 'covered', label: 'Hits', align: 'right' }, |
| 111 | { key: 'total', label: 'Found', align: 'right' }, |
| 112 | { key: 'coverage', label: 'Coverage', align: 'right' }, |
| 113 | ], |
| 114 | rows: objectToEntries(report) |
| 115 | .map(([type, files]) => { |
| 116 | const stats = aggregateCoverageStats(files); |
| 117 | return { |
| 118 | ...stats, |
| 119 | type: capitalize(type), |
| 120 | coverage: formatCoveragePercentage(stats), |
| 121 | }; |
| 122 | }) |
| 123 | .toSorted((a, b) => b.total - a.total), |
| 124 | }), |
| 125 | ); |
| 126 | } |
no test coverage detected