test(benchmark): report each scenario as it finishes

Print the report header before the measured runs and each scenario's rows
as soon as its repetitions complete, so a timed-out job still shows the
finished scenarios. The final report, scenarios, warm-ups, repetitions,
assertions, heap limit and timeout are unchanged.

Refs #281

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nessarandClaude Opus 5.5 committed 2026-10-16 23:36:11 +02:00
1 parent 4d26e65672
commit 24c35542a8
2 files changed
+29 -11

No files matched your search

@@ -1,7 +1,9 @@
import { vi } from 'vitest';
import { createPlanningCalculation } from '../services/leave-planner.service';
import {
BENCHMARK_REPORT_HEADER,
benchmarkReport,
benchmarkReportRows,
benchmarkScenarios,
runLeavePlannerBenchmark,
} from './leave-planner-benchmark';
@@ -64,7 +66,10 @@ describe('leave planner benchmark protocol', () => {
),
).toHaveLength(2);
}
const measurements = await runLeavePlannerBenchmark(2);
console.info(BENCHMARK_REPORT_HEADER);
const measurements = await runLeavePlannerBenchmark(2, (rows) =>
console.info(benchmarkReportRows(rows)),
);
for (const [name, placements] of [
['two years', 60],
['three years', 90],