Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Karma Code Coverage Exit Code is always 0 even when test coverage threshold is not met #3810

Open
koobbbyyyy opened this issue Aug 24, 2022 · 1 comment

Comments

@koobbbyyyy
Copy link

koobbbyyyy commented Aug 24, 2022

Hey there im looking out for some support,

Am working on a project and trying to make a script stop if the code Coverage don't meet the predetermined thresholds.

Just for testing reasons and to show the issue i set the threshold for statements to 100% in my karma.config.js

I would now expect the script that I run to fail/stop when it comes to the karma code coverage, but it just shows me an error that the thresholds are not met and then proceed with the next part of my script.

After doing some research I can see that the exit code of the code coverage is 0 no matter if it mets the predetermined threshold or not. I guess this should be 1 if the threshold is not met so it would fail, but it isnt.
Screenshot 2022-08-30 091413

Is there a workaround, configuration or any kind of solution for this problem?

Im working with "karma": "6.3.20" and karma-coverage": "2.2.0

Any Help is appreciated

@disja
Copy link

disja commented Aug 25, 2022

I have the same problem. A fix or workaround would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants