Vitest followup: switch to happy-dom, cleanup/fixes to mocks#21359
Merged
davelopez merged 18 commits intogalaxyproject:devfrom Nov 25, 2025
Merged
Vitest followup: switch to happy-dom, cleanup/fixes to mocks#21359davelopez merged 18 commits intogalaxyproject:devfrom
davelopez merged 18 commits intogalaxyproject:devfrom
Conversation
Added shared config mock to reduce duplication across tests. The mock provides a flexible default config that tests can override using setMockConfig(). Removed unused mocks: - font.js and style.js: Vite handles CSS and font imports natively - src/app/__mocks__/index.js: All tests use inline mocks with test-specific data - WorkflowRunSuccess.vue: Test uses inline mock instead
Converted Login, Register, and CitationsList tests to use the shared config mock instead of inline duplicates. Tests can now call setMockConfig() to customize config values while sharing the mock implementation.
Four tests were using empty config {} so they just use the shared mock now.
Two tests both used toolbox_auto_sort so they now share that config too.
happy-dom is faster and lighter with better standards compliance. Should make tests run quicker overall.
Missing closing bracket in attribute selectors that jsdom was lenient about.
Happy-dom natively supports setImmediate, structuredClone, and HTMLDialogElement, so we can remove those polyfills. Mock KaTeX entirely since we don't test it directly - this avoids the quirks mode warning it logs at module load time.
davelopez
approved these changes
Nov 25, 2025
Contributor
davelopez
left a comment
There was a problem hiding this comment.
Very cool!
Just some minor comments, mostly out of curiosity.
|
This PR was merged without a "kind/" label, please correct. |
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.
__mocks__directories🔥 With this, on my macbook I'm seeing ~22 seconds for the whole
yarn testnow. 🔥How to test the changes?
(Select all options that apply)
License