Repository navigation
chore(test): document the Vitest project split - #3531
Merged
Merged
Conversation
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.
|
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
The Vitest TODO suggested moving renderer util tests into the node project. I measured the current split before changing it:
storageuseslocalStorage,keyboardusesdocument,audiousesAudio,queryClientusesnavigator, and the system/auth tests usewindow.gitify.threadsandforksfail 71 files on@primer/reactCSS imports (ERR_UNKNOWN_FILE_EXTENSION);vmThreadsis 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.mdparse warning frompnpm test.Test plan
pnpm checkpnpm test— 204 files, 1,974 testsFollow-up
Coverage is the dominant cost (
pnpm test63s vs 22s without coverage). A separate change could makepnpm testfast and addtest:coveragefor CI; that is deliberately out of scope here.