feat: add dist/report.js

This commit is contained in:
2026-09-25 11:58:36 +08:00
parent e11b7a8be9
commit be6ddb016c

13
dist/report.js vendored Normal file
View File

@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatReport = formatReport;
function formatReport(report) {
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');
}