Skip to content

chore: migrate from Jest to Vitest #364

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

Merged
merged 6 commits into from
Jun 9, 2023
Merged

chore: migrate from Jest to Vitest #364

merged 6 commits into from
Jun 9, 2023

Conversation

nickserv
Copy link
Member

@nickserv nickserv commented May 23, 2023

What: migrate from Jest to Vitest

Why: Vitest is faster than Jest, compatible with most Jest APIs, and has better compatibility with Vite

How: migrate from Jest to Vitest

Checklist:

  • Tests
  • Ready to be merged

Notes:

  1. I’m a little confused as to why there are two Vite configs (a main one which imports an inline one from scripts) and whether I edited the right one. Could you please explain?
  2. The commit hook for Vitest is stalling locally on my machine. I'm not sure why, and since I have a slower machine and I don't personally care about running commit hooks, I'm skipping them for now. If you want I can attempt to fix this or preferably remove the commit hook later when I have more time and energy.

@nickserv nickserv requested a review from smeijer May 23, 2023 03:49
@smeijer
Copy link
Member

smeijer commented May 23, 2023

Thanks! I'll take a look soon. Re the multiple configs, the one inside scripts is to build the chrome extension. You can ignore that. The site and tests can use the one in the root.

Re commit hook, it's fine if that gets disabled. But tests should be able to run on dev machines. Even on slower ones, so that developers don't rely on ci only. Remember, actions won't automatically run for first time contributors.

@nickserv nickserv requested a review from ambarvm May 23, 2023 15:45
ambarvm
ambarvm previously approved these changes May 23, 2023
nickserv added 2 commits May 23, 2023 19:03
This fixes the issue that caused a production build of React to be used in tests. If this causes issues with other builds, please let me know.
@nickserv nickserv mentioned this pull request May 24, 2023
2 tasks
@smeijer smeijer merged commit 2eae3e5 into main Jun 9, 2023
@smeijer smeijer deleted the vitest branch June 9, 2023 08:21
@smeijer smeijer removed their request for review June 9, 2023 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants