3 ms·
We gave up and switched to vitest.
by searchableguy 3y ago
We gave up and switched to vitest.
- flohofwoe 3y ago+1 for vitest :D I was amazed that it "just worked" after struggling for hours getting jest to work because of silly file extension problems (really... what's up with that... wouldn't that be easy to fix if the Node.js and Typescript teams would talk for 5 minutes and agree on one approach?)
- davidy123 3y agoI don't use Vite though. Aside from typescript, I'm trying to be as vanilla/unopinionated as possible, using Web Components for example. And there are hundreds of Jest tests I don't want to port.
- flohofwoe 3y agoYou can use vitest like a standalone testing tool, it will install vite as dev-dependency but you don't need to build your whole project around vite. In my case it was literally a drop-in-replacement for jest, done in two minutes and without a config file. A simple config file only was required a bit later when I added test- and coverage-reporting as junit.xml and cobertura format for Gitlab CI. Didn't even have to change a single line of testing code (I didn't use Jest's mocking magic in that project though).
- davidy123 3y agoThank you, it sounds pretty good, especially solving the modules problem. I will look into it when finished current sprint.
- davidy123 3y agoJust wanted to say thanks for this recommendation. I'm not finished yet, but it seems like a huge improvement over all the wtf of jest, along with a lot of new niceties.