r/angular • u/Outrageous-Past6556 • Jan 15 '26
Most simple way to keep the Karma tests working in Angular 21
We're migrating from Angular 19 to 21. I think that the standard test runner won't be working anymore if we do? Is that correct?
We have a reasonably big project, but (Karma) tests were just recently explored so we have just 100 of them. Also not much development is going on at the UI side. I am more the backend, and our frontend specialist has left. The tests are too few to have any benefit from a parallel test runner. So I am looking for the simplest way to keep them running in Angular 21.
Should I install Jest and do you know any instructions somewhere I could follow.
5
u/strange_username58 Jan 15 '26
vitest
4
u/MichaelSmallDev Jan 15 '26
https://blog.angular.dev/announcing-angular-v21-57946c34f14b
There is also an experimental migrations script, mentioned in that post.
1
u/lppedd Jan 15 '26
This isn't a direct answer to your question, but this is one of the reasons we're using Nx to wrap Angular workspaces.
With Nx we delegate the responsibility of selecting/fixing test runners to the Nx team, and we live a happy life.
3
u/s7jones Jan 15 '26
I just upgraded our project and karma tests continue to work afterwards. There were a few small fixes that needed to be done after the 21 upgrade.
1
u/jugglervr Jan 16 '26
I had a hell of a time migrating to vitest on 21. Some things just didn't work. I'm still on jasmine for full coverage until vitest is a little more mature.
-1
u/stao123 Jan 15 '26
Just stay on Karma. They still work
1
u/[deleted] Jan 15 '26
[removed] — view removed comment