Skip to content

test: Migrate all packages from jest to vitest #13

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 3 commits into from
Aug 7, 2024
Merged

Conversation

rekmarks
Copy link
Member

@rekmarks rekmarks commented Aug 4, 2024

Jest's ESM support sucks (ref) and is held up on some interminable issues related to Node VMs (ref). I was impressed with vite and vitest following my experience implementing #8, and after I discovered that vitest has a browser mode for unit tests—which will ultimately allow us to test under ses in an actual browser environment—I was sold.

This migrates the entire repo from jest to vitest. They work very similarly, except vitest has a number of benefits over jest, such as not polluting the global namespace by default. I tried running some tests under ses with lockdown in the browser, and it worked perfectly. However, it's held up on rewriting tests that rely on JSDOM, so we're tracking that work in #12.

Testing

To test this locally, just try running the package.json test scripts in any package, including the root.

@rekmarks rekmarks requested a review from a team as a code owner August 4, 2024 08:58
@rekmarks rekmarks changed the title test: Migrate monorepo to vitest test: Migrate entire monorepo to vitest Aug 4, 2024

This comment was marked as resolved.

@rekmarks rekmarks changed the title test: Migrate entire monorepo to vitest test: Migrate all packages from jest to vitest Aug 5, 2024
Copy link
Contributor

@grypez grypez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vite is cool. LGTM.

@rekmarks rekmarks merged commit 6698e3a into main Aug 7, 2024
18 checks passed
@rekmarks rekmarks deleted the rekm/vitest branch August 7, 2024 15:56
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.

2 participants