Closed kalpesh-b closed 4 years ago
Hi @kalpesh-b, it looks like this issue might be related to Angular CLI, so I'm transferring this ticket to CLI repo. Thank you.
@kalpesh-b, have you tried remove the node_modules
and install them again? Also as testing builder you are using @angular-devkit/build-angular:karma
?
@alan-agius4, Yes tried removing node_modules, doing npm cache clean --force
as well.
I also tried downgrading node from 12.13.1
to 11.14.0
and then to 10.15.3
.
I have also tried AngularCli 8.2.14
& 8.2.0
Yes test "builder": "@angular-devkit/build-angular:karma",
One thing I have noticed is that I get this error only when I use "codeCoverage": true
in angular.json
or --code-coverage=true
in script.
If I remove "codeCoverage" flag the test cases executes without any errors but I won't get any coverage.
=============================== Coverage summary ===============================
Statements : Unknown% ( 0/0 )
Branches : Unknown% ( 0/0 )
Functions : Unknown% ( 0/0 )
Lines : Unknown% ( 0/0 )
================================================================================
In both cases, all the test cases execute successfully.
What I am thinking is that karma-coverage
might be conflicting with karma-coverage-istanbul-reporter
.
In your karma.config.js
do you have coverage
set as reporter? If that's the case, can you try to remove it.
Internally we add coverage-Istanbul
to the reporters when code coverage us enabled.
If the problem persist please share your karma.config.js
.
@alan-agius4 Actually removing karma-junit-reporter
fixed the issue.
Thanks for your help :)
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
I upgraded the project from Angular7 to Angular8. (for now, I haven't upgraded Nx, the current version used is "@nrwl/nx": "7.8.7",)
After upgrade, my application runs successfully (without any issues in build or deploy), unit test executes successfully when I run it module wise, but when I run the test cases it for an app it fails and throws below error
script used
Log
I'm using karma jasmine for the same
ng --version
I tried it with multiple node versions but still same.
Can you please let me know what can be the issue?
Thanks in advance.