When I am trying to run the Unit test cases for the first time in angular application I am facing JIT compiler issue and all my test cases are failing. When I delete the node modules, dist folder and install them again and run the test cases then all the test cases are passed with no JIT compiler issue.
I have read the Angular documentation and checked my Karma.conf.js, Angular.json, tsconfig.json files but didn't find any solution everything seems to be correct.
The below is the error that I am facing when I run test cases for the first time Error: Errors during JIT compilation of template for HeaderComponent: