@lark-project/cli
Version:
飞书项目插件开发工具
28 lines (27 loc) • 1.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.renderMatrix = void 0;
function renderMatrix(catalog, results) {
const passed = results.filter(r => r.pass).length;
const lines = [];
lines.push(`# Conformance Matrix — ${catalog.point_type}`);
lines.push('');
lines.push(`Total ${results.length} · ✅ ${passed} · ❌ ${results.length - passed}`);
lines.push('');
lines.push('| probe id | field | constraint | scenario | expect | actual | result |');
lines.push('|---|---|---|---|---|---|---|');
for (const r of results) {
const mark = r.pass ? '✅ PASS' : '❌ FAIL';
lines.push(`| ${r.probe.id} | ${r.probe.field} | ${r.probe.constraint} | ${r.probe.scenario} | ${r.probe.expect.outcome} | ${r.actualOutcome} | ${mark} |`);
}
const fails = results.filter(r => !r.pass);
if (fails.length) {
lines.push('');
lines.push('## FAIL details');
for (const r of fails)
lines.push(`- **${r.probe.id}**: ${r.detail}`);
}
lines.push('');
return lines.join('\n');
}
exports.renderMatrix = renderMatrix;