Testing
Testing is a crucial part of software development, especially for large applications, as it improves reliability and maintainability.
The Angular testing ecosystem is currently in a transitioning state. Officialy supported tools are deprecated, and the community is actively exploring modern alternatives. Expect recommendations and best practices to evolve in the near future as the ecosystem stabilizes.
Testing frameworks
✅ Karma is the pre-installed test runner with Jasmine as the assertion library.
- ✅ Officially supported by Angular
- ✅ Real browser testing
- ❌ Deprecated and no longer maintained
- ❌ Slow
- ❌ Angular support will probably drop in future releases
Even if Karma is deprecated, it is still a valid option as it's the only officially supported framework, and it gets the job done. Other options may or may not be supported in the future, they are currently not as well integrated with Angular and may require additional configuration to work.
✅ Vitest
- ✅ Fast
- ✅ Real browser testing (experimental)
- ❌ No official Angular support (experimental support introduced in Angular v20)
✅ Jest
- ✅ Fast
- ❌ Experimental Angular support
- ❌ No real browser testing (uses JSDOM)
- ✅ Real browser testing
- ❌ Experimental Angular support
End-to-end testing tools (e2e)
✅ Cypress
❌ Protractor: deprecated and no longer maintained.