feat(create-rslib): use happy-dom instead of jsdom#1412
Merged
Conversation
…ironment in rstest template
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates from jsdom to happy-dom as the default test environment for all rstest templates in the create-rslib package. The change is motivated by performance improvements (approximately 10% faster according to the benchmark in the PR description), though happy-dom has fewer APIs than jsdom.
Key Changes:
- Replaced
jsdomdependency withhappy-dom(version ^20.0.11) across all rstest templates - Updated
testEnvironmentconfiguration from'jsdom'to'happy-dom'in all rstest config files - Applied changes consistently across React and Vue templates, both JavaScript and TypeScript variants
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/create-rslib/template-[vue]-[rstest]-ts/rstest.config.ts |
Updated testEnvironment to happy-dom for Vue TypeScript rstest template |
packages/create-rslib/template-[vue]-[rstest]-ts/package.json |
Replaced jsdom dependency with happy-dom for Vue TypeScript rstest template |
packages/create-rslib/template-[vue]-[rstest]-js/rstest.config.js |
Updated testEnvironment to happy-dom for Vue JavaScript rstest template |
packages/create-rslib/template-[vue]-[rstest]-js/package.json |
Replaced jsdom dependency with happy-dom for Vue JavaScript rstest template |
packages/create-rslib/template-[vue]-[rstest,storybook]-ts/rstest.config.ts |
Updated testEnvironment to happy-dom for Vue TypeScript rstest+storybook template |
packages/create-rslib/template-[vue]-[rstest,storybook]-ts/package.json |
Replaced jsdom dependency with happy-dom for Vue TypeScript rstest+storybook template |
packages/create-rslib/template-[vue]-[rstest,storybook]-js/rstest.config.js |
Updated testEnvironment to happy-dom for Vue JavaScript rstest+storybook template |
packages/create-rslib/template-[vue]-[rstest,storybook]-js/package.json |
Replaced jsdom dependency with happy-dom for Vue JavaScript rstest+storybook template |
packages/create-rslib/template-[react]-[rstest]-ts/rstest.config.ts |
Updated testEnvironment to happy-dom for React TypeScript rstest template |
packages/create-rslib/template-[react]-[rstest]-ts/package.json |
Replaced jsdom dependency with happy-dom for React TypeScript rstest template |
packages/create-rslib/template-[react]-[rstest]-js/rstest.config.js |
Updated testEnvironment to happy-dom for React JavaScript rstest template |
packages/create-rslib/template-[react]-[rstest]-js/package.json |
Replaced jsdom dependency with happy-dom for React JavaScript rstest template |
packages/create-rslib/template-[react]-[rstest,storybook]-ts/rstest.config.ts |
Updated testEnvironment to happy-dom for React TypeScript rstest+storybook template |
packages/create-rslib/template-[react]-[rstest,storybook]-ts/package.json |
Replaced jsdom dependency with happy-dom for React TypeScript rstest+storybook template |
packages/create-rslib/template-[react]-[rstest,storybook]-js/rstest.config.js |
Updated testEnvironment to happy-dom for React JavaScript rstest+storybook template |
packages/create-rslib/template-[react]-[rstest,storybook]-js/package.json |
Replaced jsdom dependency with happy-dom for React JavaScript rstest+storybook template |
packages/create-rslib/fragments/tools/rstest-vue-ts/rstest.config.ts |
Updated testEnvironment to happy-dom in Vue TypeScript rstest fragment |
packages/create-rslib/fragments/tools/rstest-vue-ts/package.json |
Replaced jsdom dependency with happy-dom in Vue TypeScript rstest fragment |
packages/create-rslib/fragments/tools/rstest-vue-js/rstest.config.js |
Updated testEnvironment to happy-dom in Vue JavaScript rstest fragment |
packages/create-rslib/fragments/tools/rstest-vue-js/package.json |
Replaced jsdom dependency with happy-dom in Vue JavaScript rstest fragment |
packages/create-rslib/fragments/tools/rstest-react-ts/rstest.config.ts |
Updated testEnvironment to happy-dom in React TypeScript rstest fragment |
packages/create-rslib/fragments/tools/rstest-react-ts/package.json |
Replaced jsdom dependency with happy-dom in React TypeScript rstest fragment |
packages/create-rslib/fragments/tools/rstest-react-js/rstest.config.js |
Updated testEnvironment to happy-dom in React JavaScript rstest fragment |
packages/create-rslib/fragments/tools/rstest-react-js/package.json |
Replaced jsdom dependency with happy-dom in React JavaScript rstest fragment |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Timeless0911
approved these changes
Dec 25, 2025
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
Use
happy-dominstead ofjsdomas default testEnvironment in Rstest template.happy-domis considered faster than jsdom, but it lacks some APIs.https://github.com/capricorn86/happy-dom/wiki/
Related Links
Checklist