Angular 16 has deprecated Karma and introduced Jest in experimental mode. Does that mean we currently have no stable testing framework? Should we s...
For further actions, you may consider blocking this person and/or reporting abuse
Great article!
Amazing!!!!
it's 2024 and we're still having the same problem. Jest is extremely slow even with the official builder
Yeah, time for an update. You're right except one thing. There is still no official builder...
I was confused with our setup initially. We use
@angular-builders
and it's not official oneFantastic article! I'm spear-heading a unit testing implementation endeavour in my current role.
There was a lot of gravitation to try to dive straight into Jest - even though we wouldn't be able to use native Jest today. This article gave me valuable insight into some of the decision factors for consideration.
We're on a pre v16 version today and my evaluation is that considering this, and given that one of our primary objectives is to leverage automation in our build pipelines with coverage enforcement I'm recommending to the team that we stick with Jasmine and Karma on the existing projects and rather start exploring Jest on any green-fields apps where we would be starting with v17 (or latest).
Would be great to get your thoughts on whether this is a pragmatically future-proofed approach. Given your comment about the state of native Jest support in v17, I'm feeling like it is.
Hi Rachel, thanks. Given Jest's current status, please stick to Jasmine whenever you can. That applies to green-field apps as well.
If Jest becomes necessary, it should be an officially supported version that uses Angular's build process.
Since the time of this article, Jest didn't really improve.
So basically the way you write the tests in typescript does not change? Is that correct? Because frankly I just started with this Jamine/Karma unit testing and was happy enough to get it running in the first place. :-(
I do not have to dump the tests I have made with such effort into the dustbin?
Yes, you can continue to write Jasmine tests and in some future version Angular will just switch the runner. For your codebase, nothing should change.
While running
ng test
command after setup.getting this error
dist/test-out/src in the roots[0] option was not found.
Hi, in which one of the existing projects did that happen?
Que buen articulo.. Me sirvio para tener un contexto actual del testing en Angular.
Gracias, estoy contento de saberlo.
Hi, thanks for this great article!
Do you know if there's a way to launch tests in a watch mode using angular native jest?
No, not yet. I also have to say that the Jest support in Angular 17 didn't really improve compared to v16.
Great article. Any issues running code coverage? So far I'm getting 0%
Hi, I mean the goal was not really to measure code coverage. Is there something in particular, you want to know?