I recently upgraded my project from Angular 13 to Angular 16 Standalone App. Earlier I was using karma for unit testing and now since Angular 16 supports JEST, I have configured the same in my application.
Updated "angular.json" file as below: "test": { "builder": "@angular-devkit/build-angular:jest", "options": { "polyfills": ["zone.js", "zone.js/testing"], "tsConfig": "tsconfig.spec.json" }
Updated "tsconfig.spec.json" as below: "compilerOptions": { "outDir": "./out-tsc/spec", "types": [ "jest", "node" ] },
Uninstalled all karma packages, test.ts and karma.config file.
Installed "jest, jest-environment-jsdom, @types/jest".
Finally, ran "ng test" command.
Now again running getting below error:
Below is my Environment File image:
Below is the "auth.service.spec" file code in which it is showing error: Auth Service Spec
I want to run my Angular 16 standalone project with JEST for unit testing, so I can start working on other test cases.