-
Notifications
You must be signed in to change notification settings - Fork 249
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 exits with code 0 when the coverage threshold is below the configuration #421
Comments
I'm experiencing the same.
reporters: ['coverage', 'spec'],
coverageReporter: {
includeAllSources: true,
dir: 'coverage/',
reporters: [
{ type: "html", subdir: "html" },
{ type: 'text' },
{ type: 'text-summary' }
],
check: {
global: {
statements: 80,
lines: 80,
branches: 80,
functions: 80
}
}
}, Karma output: 07 08 2020 13:41:20.282:ERROR [coverage]: Chrome Headless 85.0.4182.0 (Linux x86_64): Coverage for branches (66.96%) does not meet global threshold (80%)
=============================== Coverage summary ===============================
Statements : 81.5% ( 1674/2054 )
Branches : 66.96% ( 612/914 )
Functions : 85.93% ( 281/327 )
Lines : 81.63% ( 1653/2025 ) Karma exits cleanly with 0. I've tried
|
See #418 |
@matz3 It looks like your PR was already merged in master. I've tested it and it works fine. Thank you very much. |
still doesn't work for me.
Exists with
macOS Catalina, nodejs v12.16.3 |
@industral It is not going to work until karma release a new version, probably v5.1.2 |
aha, got it. Thanks @jesusbarcenilla for clarifying. Well, waiting :) |
Solved with karma v5.2.0 (in combination with karma-coverage v2.0.3) |
Thanks @matz3 |
Hi,
I added this configuration to my karma.conf.js
The logs work fine and if the thresholds are not met, I can see error logs in the terminal but karma always exit wit code 0. That affect my CI process that is not able to detect something is wrong.
The documentation says
and I've review the code and I've seen the plugin is setting the exit code to 1 so I'm not sure if it is a issue in karma-coverage or in karma itself.
I'm using :
karma@5.1.1
karma-coverage@2.0.3
The text was updated successfully, but these errors were encountered: