Open zijianhuang opened 7 months ago
Web Test Runner is preferable because of testing CORS in integration test suites. However, as of today, on https://angular.dev/ and angular.io, the tutorials about testing is still using Karma.
https://modern-web.dev/guides/test-runner/typescript/ https://modern-web.dev/docs/test-runner/cli-and-configuration/ https://modern-web.dev/docs/dev-server/plugins/esbuild/
As of today, NG team hasn't figure out the solutions, since jest is basically Node based, while browser based test is important too.
https://github.com/karma-runner/karma#karma-is-deprecated-and-is-not-accepting-new-features-or-general-bug-fixes
===========================
so Angular is adding Jest and Web Test Runner support to provide a migration path off of Karma. See the Angular blog for more details.
Critical security issues in Karma will still be triaged and fixed as necessary. This will continue until 12 months after Angular CLI's Web Test Runner support is marked stable.
For those outside Angular looking to migrate off Karma, both Web Test Runner and jasmine-browser-runner provide browser-based unit testing solutions which can be used as a direct alternative. Jest and Vitest also provide Node-based alternatives.
============================