( threshold: BenchmarkThreshold | undefined, unit: BenchmarkMetricResult["unit"], )
| 305 | } |
| 306 | |
| 307 | function formatThreshold( |
| 308 | threshold: BenchmarkThreshold | undefined, |
| 309 | unit: BenchmarkMetricResult["unit"], |
| 310 | ) { |
| 311 | if (!threshold) { |
| 312 | return "—"; |
| 313 | } |
| 314 | |
| 315 | return `+${((threshold.maxRegressionRatio - 1) * 100).toFixed(0)}% and +${formatThresholdValue( |
| 316 | threshold.minAbsoluteRegression, |
| 317 | unit, |
| 318 | )}`; |
| 319 | } |
| 320 | |
| 321 | /** Render a compact Markdown report suitable for GitHub Actions summaries. */ |
| 322 | export function formatComparisonMarkdown( |
no test coverage detected