feat: add src/report.ts
This commit is contained in:
9
src/report.ts
Normal file
9
src/report.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import type { TraceReport } from './model';
|
||||||
|
|
||||||
|
export function formatReport(report: TraceReport): string {
|
||||||
|
const lines = [`覆盖率 ${report.percent}% (${report.covered}/${report.total})`];
|
||||||
|
for (const gap of report.gaps) lines.push(`${gap.requirementId}: ${gap.reason}`);
|
||||||
|
if (report.orphanCases.length) lines.push(`无效关联: ${report.orphanCases.join(', ')}`);
|
||||||
|
if (report.duplicateCases.length) lines.push(`重复用例: ${report.duplicateCases.join(', ')}`);
|
||||||
|
return lines.join('\n');
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user