(checks)
| 751 | } |
| 752 | |
| 753 | function markdownTable(checks) { |
| 754 | if (checks.length === 0) { |
| 755 | return "_None._\n"; |
| 756 | } |
| 757 | |
| 758 | const lines = [ |
| 759 | "| Status | Scenario | Metric | Baseline | Current | Delta | Threshold |", |
| 760 | "| --- | --- | --- | ---: | ---: | ---: | --- |", |
| 761 | ]; |
| 762 | |
| 763 | for (const check of checks) { |
| 764 | lines.push( |
| 765 | [ |
| 766 | `| ${statusToLabel(check.status)}`, |
| 767 | `${scenarioToString(check)}`, |
| 768 | `${check.metric}`, |
| 769 | `${formatNumber(check.baselineValue)}`, |
| 770 | `${formatNumber(check.currentValue)}`, |
| 771 | `${formatDelta(check.delta, check.deltaPct)}`, |
| 772 | `${formatThreshold(check.threshold)} |`, |
| 773 | ].join(" | "), |
| 774 | ); |
| 775 | } |
| 776 | |
| 777 | return `${lines.join("\n")}\n`; |
| 778 | } |
| 779 | |
| 780 | export function toMarkdownReport(report, paths) { |
| 781 | const hard = report.checks.filter((c) => HARD_STATUSES.has(c.status)); |
no test coverage detected