Configure Vitest environments centrally - #1872
Merged
Merged
Conversation
The web-girder plugin layer reads `window` at import time, so every spec under platform/web-girder needs a DOM; name the directory rather than the individual files. jsdom 30 implements Blob.text() and Blob.arrayBuffer(), which the File-based specs in that tree rely on. jsdom 24 implements neither.
PaulHax
marked this pull request as ready for review
August 29, 2026 13:39
BryonLewis
approved these changes
Aug 29, 2026
This was referenced Aug 29, 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.
Configure Vitest environments centrally
Test files should not need repeated Vitest headers.
Changes
src/components/**,dive-common/components/**) and everything underplatform/web-girder/**run in a shared jsdom project; the rest stay in Vitest's Node environment.The whole
platform/web-girdertree needs a DOM: its plugin layer readswindowat import time, so any spec that reaches the API layer fails without one. Naming the directory rather than individual files means a new spec added there needs no config edit.jsdom 24 implements none of
Blob.text(),Blob.arrayBuffer(), orBlob.stream(). Two specs in that tree buildFileobjects and passed only because Node'sFileis more spec-compliant than the DOM environment's. jsdom 30 providestext()andarrayBuffer().stream()is still absent, and is used only by the stereo tests, which stay in Node because they resolve binary fixtures throughfileURLToPath(import.meta.url).Four specs that carried
@vitest-environment jsdomon main now run in Node:platform/desktop/backend/serializers/viame.spec.ts,platform/desktop/sharedUtils.spec.ts, and bothsrc/alignedView/homography.spec.tsandsrc/alignedView/transform.spec.ts. They pass — the directives were unnecessary.Validation