webapiclientgen icon indicating copy to clipboard operation
webapiclientgen copied to clipboard

migrate the ng test suites to jest

Open zijianhuang opened this issue 1 year ago • 3 comments

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.

============================

zijianhuang avatar Apr 10 '24 01:04 zijianhuang

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/

zijianhuang avatar Apr 19 '24 22:04 zijianhuang

As of today, NG team hasn't figure out the solutions, since jest is basically Node based, while browser based test is important too.

zijianhuang avatar Apr 21 '24 09:04 zijianhuang