#Angular announcement: We're moving Angular to #Jest and #WebTestRunner.
We've seen a lot of movement in the web testing ecosystem towards Jest and want to make it more available for #AngularCLI users.
We've also been particular impressed with Web Test Runner and are looking forward to bringing it into the Angular ecosystem as well.
Check out the #AngularBlog for all the details:
https://medium.com/angular-blog/moving-angular-cli-to-jest-and-web-test-runner-ef85ef69ceca
@develwithoutacause Why not Vitest? It’s pretty popular too according to https://2022.stateofjs.com/en-US/libraries/testing/ and the first recommended test runner for Vue (with Jest being the third option) https://vuejs.org/guide/scaling-up/testing.html The blog post doesn’t really explain the decision. Is there a reason why the Angular team prefers Jest over Vitest?
@diakur We did consider Vitest and do agree that it could make a viable unit testing solution for Angular.
Ultimately however we try to listen to the community and pretty overwhelmingly users were asking for Jest and not Vitest. Many Angular apps already run Jest today and have found success with it.
Vitest seems to be well-liked by people who use it, but it still has relatively low usage compared to Jest which has dominated the unit testing market for years.
From an Angular perspective with a large established user base, we need to make sure any new solution doesn't _just_ meet the needs of 90% of our users' requirements, but actually meets the whole 100%. And a heavily used tool like Jest already meeting those requirements for real Angular apps gives us a lot more confidence that it can handle the various edge cases it will need to support as we reach a fully productionized solution.
@develwithoutacause @web/test-runner getting some nice love!! Looking forward to what Angular can bring to the larger testing convo with this move
@develwithoutacause this is exciting! I’m hoping as folks start playing with it, we get some good metrics to share.
Interestingly we tried switching to Jest on a project around v10 and were pretty impressed by it, but ended up going back to Jasmine after a few versions. For some reason, the Jest tests were way slower than the stock setup after Ivy (like 5x slower to rerun a suite).
Never took the time to dig in, it’s quite possible it was a weird setup we had. But excited to try it again!
@mattdsteele @develwithoutacause This is likely due to JSDOM being the default in the past. Emulating the browser has a lot of overhead as well.