perf(browser): fork jest-dom instead of bundling it#7605
perf(browser): fork jest-dom instead of bundling it#7605sheremet-va merged 33 commits intovitest-dev:mainfrom
Conversation
✅ Deploy Preview for vitest-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
hi-ogawa
left a comment
There was a problem hiding this comment.
Looks good to me! Just have a few questions about testing.
hi-ogawa
left a comment
There was a problem hiding this comment.
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
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:.