Skip to content
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

Switch from Jest to Vitest #4153

Open
nolanlawson opened this issue Apr 15, 2024 · 1 comment
Open

Switch from Jest to Vitest #4153

nolanlawson opened this issue Apr 15, 2024 · 1 comment
Labels

Comments

@nolanlawson
Copy link
Contributor

Despite the existence of lwc-test and its various @lwc/jest-* packages, this repo itself does not require Jest. So we can switch to another test runner if we want.

...And I kind of want to. After trying to upgrade Prettier to v3 (#4140) and noticing how thoroughly broken ESM support in Jest still is to this day, my wandering eye turns to Vitest. Which I know from experience is pretty dang fast, has decent Jest API compat, and doesn't require any special tooling other than standard Rollup plugins.

It would probably be an effort on our end since we have a lot of tricky jest.config.js files and custom matchers, but it should be doable to switch over. Then we can really make some progress on upgrading Prettier and other dependencies that require ESM.

@wjhsf
Copy link
Contributor

wjhsf commented Apr 16, 2024

It would probably be an effort on our end since we have a lot of tricky jest.config.js files and custom matchers, but it should be doable to switch over.

If vitest is like the other frameworks and lets you bring your own assertion library, we could do this in parts if we need to. We could do a framework migration first, then a "simple assertions" migration, then custom matchers last.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants