build(deps): upgrade to vitest 5 - #120
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
Reviewed changes have no unresolved blocking issues.
Review effort: Lite
Findings: None
What changed in this PR
Upgrades Vitest and coverage tooling to 5.x, adapting benchmark execution and reporting to the redesigned API.
Changes:
- Migrates benchmarks to Vitest 5’s context-based API.
- Adds tested reporting, baseline, and comparison helpers.
- Updates dependencies, documentation, scripts, and a property-test timeout.
| File | Description |
|---|---|
test/property/store.property.test.ts |
Increases the I/O-heavy property-test timeout. |
test/benchmark-report.test.ts |
Tests benchmark reporting and comparison behavior. |
package.json |
Upgrades Vitest dependencies and benchmark scripts. |
package-lock.json |
Locks updated dependency versions. |
docs/TESTING.md |
Documents benchmark commands and output. |
benchmarks/report.ts |
Provides benchmark reporting and comparison helpers. |
benchmarks/core.bench.ts |
Uses the Vitest 5 benchmark context API. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
trvon
force-pushed
the
build/vitest-5
branch
from
September 20, 2026 02:07
a404aeb to
20e49bc
Compare
Owner
Author
trvon
added this pull request to stack #121
September 20, 2026 02:20
Move vitest and @vitest/coverage-v8 to 5.x. Vitest 5 removed the module-level bench() export, the built-in benchmark table, and the --outputJson/--compare flags. Rewrite benchmarks/core.bench.ts against the context bench() API (run options carry time/warmupTime) and add benchmarks/report.ts for table, baseline, and comparison formatting, selected via BENCH_BASELINE_OUT/_IN. Cover the report helpers with a unit test and document the bench scripts. Also give the disk-bound workflow store property its own 60s timeout, which intermittently exceeded the default under parallel load.
trvon
force-pushed
the
build/vitest-5
branch
from
September 20, 2026 02:24
20e49bc to
7917200
Compare
This was referenced Sep 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes the vitest 5 upgrade that #119 held back (closes the migration deferred from #106 and #108). Moves
vitestand@vitest/coverage-v8to 5.x and adapts the benchmark tooling to the redesigned API.Vitest 5 removed:
bench()export (it now lives on the test context:test("...", ({ bench }) => ...)),--outputJsonand--compareCLI flags.Changes:
benchmarks/core.bench.tsrewritten against the contextbench()API. Timing (time/warmupTime) moved from per-benchmark options to the run options passed to.run().benchmarks/report.ts(new) holds pure, tested helpers for the results table, the baseline JSON, and the throughput comparison — the formatting vitest 5 no longer provides.bench:baseline/bench:comparenow select mode throughBENCH_BASELINE_OUT/BENCH_BASELINE_INenv vars instead of the removed flags. The baseline still lands at.artifacts/benchmarks/baseline.jsonand the operator workflow is unchanged.test/benchmark-report.test.ts(new) covers the report helpers, including the new-benchmark and zero-baseline edge cases in the comparison math.docs/TESTING.mddocuments the three bench scripts.Also gives the
never persists more fires than the selected controller capproperty test a 60s timeout (same fix as #119) — it does real store I/O and intermittently exceeded the 15s default under parallel load. If #119 merges first, this hunk is identical and rebases cleanly.Test plan
npm run test:coverage— 67 files, 1066 tests pass; coverage above thresholdsnpm run typecheck,npm run lint(2 pre-existing warnings),npm run buildnpm run test:package,npm run test:propertynpm run bench,npm run bench:baseline,npm run bench:compareall produce outputnpm audit --audit-level=moderate— 0 vulnerabilitiesNote
Benchmarking is marked experimental in vitest 5, so the
report.tshelpers deliberately depend only on the stable tinybench statistics (latency/throughputmeans,rme), not on vitest's evolving benchmark types.