Skip to content

chore(dev-tools): upgrade shared test tooling to Vitest 5 - #59

Merged
ibgreen merged 2 commits into
masterfrom
codex/vitest-5-support
Sep 30, 2026
Merged

ibgreen merged 2 commits into
masterfrom
codex/vitest-5-support

Conversation

@ibgreen

@ibgreen ibgreen commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Goals

Let consumers use Vitest 5 with the shared Node/Playwright configuration without overriding dev-tools' Vitest 4 browser dependencies. This follows the compatibility investigation in visgl/loaders.gl#4072.

Changes

  • Upgrade the browser dependencies and Vitest/V8 coverage peers to ^5.0.2, and align the repository's test dependencies and lockfile.
  • Declare Vite as a required peer (^6.4.0 || ^7.0.0 || ^8.0.0) and install it explicitly in the repository for Yarn.
  • Document the Vitest 4-to-5 upgrade, explicit Vite installation, mock/async-assertion changes, coverage file selection, and CI blob-report paths.
  • Verify nested documentation sidebar normalization with a native Vitest behavior test.
  • Add a Chromium module-automocking check through the shared Playwright provider, and ignore generated .vitest/ artifacts.

The configuration helper's public API and the existing Node support range are unchanged. This moves the supported Vitest major to 5; it does not advertise dual Vitest 4/5 support.

Validation

  • yarn and yarn build passed.
  • yarn lint fix passed; the new browser files also passed Biome explicitly.
  • yarn test: 10 files / 24 tests passed, including the new browser module mock.
  • yarn test-headless: 1 file / 2 tests passed.
  • Built ESM and CommonJS entrypoints both load and create the three default projects.
  • CI on Node 22 passed immutable installation, bootstrap/build, lint, Node/browser tests, headless tests, coverage, and Coveralls.
  • Local yarn cover on macOS / Node 24.5.0 hit the existing 120-second timeout in compiler-transform tests. A single-worker diagnostic was also prohibitively slow. No timeouts, worker defaults, compiler fixtures, or coverage exclusions were changed to hide this limitation.

The downstream loaders.gl POC passed its full Node and Chromium suites. Its coverage reports additionally include deprecated compatibility exports under Vitest 5, so the migration guidance preserves that expanded denominator; the downstream POC added focused coverage for its retained mesh-bounds export and now passes its full CI, including browser-only and merged coverage gates. Local timing variation was too large to claim a reliable speedup.

Vitest emits an upstream Vite warning about configureServer on vitest:mocks:interceptor; the explicit browser mocking test passes despite it.

Vitest 5 migration guide

Coverage comparison

The initial Coveralls result dropped from 57.6577% to 57.5812%. File-level comparison identifies exactly two changed lines: the light/dark theme initializers in modules/docusaurus-website/src/get-default-config.ts changed from covered to non-coverable. Uncovered lines (272) and covered/total branches (294/492) were unchanged. This is a reporting difference, not lost execution coverage.

The added sidebar test exercises previously untested recursive normalization of string and object entries, preserving existing coverage settings. Local lint, targeted coverage, and the full 24-test suite pass. The follow-up CI run passes, and Coveralls now reports 58.484% versus 57.658% on master: 350 covered lines and 298 covered branches. No threshold, exclusion, or production code was changed.

@coveralls

coveralls commented Sep 29, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 36631922766

Coverage increased (+0.8%) to 58.484%

Details

  • Coverage increased (+0.8%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 616
Covered Lines: 350
Line Coverage: 56.82%
Relevant Branches: 492
Covered Branches: 298
Branch Coverage: 60.57%
Branches in Coverage %: Yes
Coverage Strength: 4.65 hits per line

💛 - Coveralls

@ibgreen
ibgreen marked this pull request as ready for review September 29, 2026 17:40
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

Comment thread test/fixtures/browser-module.ts
@ibgreen
ibgreen merged commit 38c5e2d into master Sep 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants