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

Feature Request: Migrate to Vitest #760

Closed
Tracked by #745
roushou opened this issue Jul 8, 2024 · 6 comments
Closed
Tracked by #745

Feature Request: Migrate to Vitest #760

roushou opened this issue Jul 8, 2024 · 6 comments

Comments

@roushou
Copy link
Contributor

roushou commented Jul 8, 2024

Describe the solution you'd like

Running unit tests with Jest currently makes my machine (Arch / 16GB ram) goes OOM while going quickly with Vitest. Both API are similar. Looking for your experience @kyhyco @Zizzamia. Maybe I'm an isolated case so it may not be worth the effort.

Describe alternatives you've considered.

No response

@Zizzamia
Copy link
Contributor

Zizzamia commented Jul 9, 2024

@roushou, my only hesitation is around having hard time to write Mock test or general less experience with those tests. And how well Github Co-Pilot can code with Vitest.

BUT, if those conditions are met, and the transition is super smooth. I am all for it.

@roushou is it something you can help us with?

Also, we do a lot of things with yarn around OnchainKit, I feel ready for us to migrate to bun as well.

@roushou
Copy link
Contributor Author

roushou commented Jul 9, 2024

I can help with both.

To give some insight with Bun. Things are fast, intuitive and I haven't had any major issue yet but I also mainly develop apps and don't really touch runtime stuff. But I remember having a few issues when using packages that relied on Node.js runtime stuff not supported by Bun.

In the context of OnchainKit, I think it can replace Yarn with no issues. Maybe for bundling to esm too (cjs/iife are not supported yet) but I don't how it behaves regarding "use client" directives #691. I haven't tried Bun tests yet.

Regarding Vitest, this is pretty much like Jest with a similar API, environments (node, jsdom, ...) with a few adjustments. There's a migration guide here. No idea about Copilot since I don't use it. IMO someone familiar with Jest should not have any issues with Vitest.

@Zizzamia
Copy link
Contributor

Zizzamia commented Jul 9, 2024

https://github.com/orgs/community/discussions/62769 🤔

I wonder if Vitest is now supported by CoPilot.

@roushou
Copy link
Contributor Author

roushou commented Jul 10, 2024

Best way to know is to try it. I don't have Copilot though

@Zizzamia
Copy link
Contributor

Done :-)

We are with Vitest.

@roushou
Copy link
Contributor Author

roushou commented Jul 12, 2024

Amazing!

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

Successfully merging a pull request may close this issue.

2 participants