-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
perf(browser): fork jest-dom instead of bundling it #7605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf(browser): fork jest-dom instead of bundling it #7605
Conversation
✅ Deploy Preview for vitest-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Just have a few questions about testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I didn't check every assertions one by one, but picked some and compared with jest-dom and I got the idea.
I spotted a few left-overs of testing-library/jest-dom in the doc
vitest/packages/browser/jest-dom.d.ts
Lines 365 to 366 in fd6c417
| * [toBeChecked](https://github.com/testing-library/jest-dom#tobechecked) or | |
| * [toHaveFormValues](https://github.com/testing-library/jest-dom#tohaveformvalues). |
Should be fixed now 👍🏻 |
Description
Migrating away from bundling
jest-domcan save us up to 40ms of load time for every test. This can stack very fast depending on the number of tests. We can also reuse PW's locator methods that can already work with accessibility which reduces overall size of the bundle.In the future, we can also make a breaking change to simplify the
expect.elementinto a simpleexpectsince we now control all matchers:Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.