Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
On the project I’m on we have roughly 1200 Jest tests. They are a mixture of unit tests and RTL tests with various mock API calls and when trying to migrate over to Vitest and Vite we got caught up with this issue which caused our project to no longer pass CI.
I used Vite to scaffold a really basic application for a tutorial. At first, it worked great, but when I needed to add some tests, I found out that Jest is not fully supported by vite and I had to jump through some hoops to get it working. With CRA it works out of the box, no setup needed, so I switched to CRA as it didn't make much sense to spend time figuring out how to set up Jest to be able to write tests for a simple tutorial app.
There are still several caveats using Vite as replacement. Personally I stumbled through these two issues a few times: [2433 - storybook related](https://github.com/vitejs/vite/issues/2433) and [2139](https://github.com/vitejs/vite/issues/2139)
Related posts
- Migrating from create-react-app to Vite: A Quick and Easy Guide
- Vitest In-Source Testing for SFC in Vue?
- Use CSS Variables to style react components on demand
- Ask HN: How do we include JavaScript scripts in a browser these days?
- Deploy a react projects that are inside a subdirectories to GitHub Pages using GitHub Actions (CI/CD)