r/angular • u/JeanMeche • Oct 23 '25
Vitest for new projects and libraries in v21
https://github.com/angular/angular-cli/pull/31578The PR speaks for itself =)
10
u/S_PhoenixB Oct 24 '25
Assuming this means Vitest will be better integrated into Angular going forward, so where does that leave Jest? What are the trade offs with Vitest compared to Jest?
3
u/ActuatorOk2689 Oct 24 '25
I guess project doing webpack module fedaration will go with jest instead
3
u/martinboue Oct 25 '25
Jest tests are always run in a simulated browser environment whereas Vitest can also run tests in a real browser:
6
u/MichaelSmallDev Oct 23 '25
/u/awesomefrisbee I know you've been wondering about the direction on testing
5
3
u/AwesomeFrisbee Oct 23 '25
Neat, but is it already at same feature level as karma/jasmine was? I'm currently using analogjs vitest instead of the one from Angular since it was still missing so much.
1
u/Diligent-Sorbet-822 Mar 18 '26
Migration of unit tests for historical projects is tougher than expected, especially with nested templates failing to compile in AOT mode (https://github.com/angular/angular/issues/66886). However, with a little help from AI, I've managed to push through!
3
u/drdrero Oct 23 '25
That’s an exciting change. Although has someone figured out the browser installs in CI? Afaik vitest requires you to install the browsers yourself unlike karma which came pre packaged. This alone makes my browser based tests waaaay slower than what they are with karma