Skip to content

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
@socket-security

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
@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.

3 participants