Skip to content

chore(test): document the Vitest project split - #3531

Merged
setchy merged 1 commit into
mainfrom
chore/vitest-project-split
Oct 25, 2026
Merged

setchy merged 1 commit into
mainfrom
chore/vitest-project-split

Conversation

@setchy

@setchy setchy commented Oct 25, 2026

Copy link
Copy Markdown
Member

Summary

The Vitest TODO suggested moving renderer util tests into the node project. I measured the current split before changing it:

  • Full suite without coverage: 22.2s; environment 2%, setup 12%, tests 54%.
  • Renderer utils are not pure: storage uses localStorage, keyboard uses document, audio uses Audio, queryClient uses navigator, and the system/auth tests use window.gitify.
  • threads and forks fail 71 files on @primer/react CSS imports (ERR_UNKNOWN_FILE_EXTENSION); vmThreads is required.

So the right configuration is to keep the process-boundary split: node for main/shared, happy-dom for preload/renderer, browser for visual. This removes the TODO and documents why a third node project would add a second renderer setup without removing the DOM coupling.

Also excludes Markdown from coverage, which removes the src/__helpers__/README.md parse warning from pnpm test.

Test plan

  • pnpm check
  • pnpm test — 204 files, 1,974 tests
  • No README coverage parse warning

Follow-up

Coverage is the dominant cost (pnpm test 63s vs 22s without coverage). A separate change could make pnpm test fast and add test:coverage for CI; that is deliberately out of scope here.

Keep node for main/shared and happy-dom for preload/renderer; benchmark shows the environment is only ~2% of suite time and vmThreads is required for Primer CSS. Exclude Markdown from coverage.
@github-actions github-actions Bot added the chore Miscellaneous tasks label Oct 25, 2026
@sonarqubecloud

Copy link
Copy Markdown

@setchy
setchy marked this pull request as ready for review October 25, 2026 22:41
@setchy
setchy requested a review from afonsojramos as a code owner October 25, 2026 22:41
@setchy
setchy merged commit 6800d40 into main Oct 25, 2026
23 checks passed
@setchy
setchy deleted the chore/vitest-project-split branch October 25, 2026 22:41
@github-actions github-actions Bot added this to the Release 7.11.0 milestone Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Miscellaneous tasks

Development

Successfully merging this pull request may close these issues.

1 participant