By defining threshold for coverage I don't want to fail tests but to emit warning.
See original GitHub issueIn package karma-coverage-istanbul-reporter
it was possible to add threshold for coverage and emit warning instead of failing tests. Here’s config example:
{
coverageIstanbulReporter: {
thresholds: {
emitWarning: true,
global: {
statements: 70,
lines: 70,
branches: 70,
functions: 70
}
}
}
}
Since former package is now deprecated I tried migrating to karma-coverage
.
In package karma-coverage
config is changed to:
{
coverageReporter: {
checks: {
global: {
statements: 70,
lines: 70,
branches: 70,
functions: 70
}
}
}
}
I can’t add emitWarning: true
to prevent tests from failing and emit simple warning.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Configuring code coverage in Jest, the right way
In Jest we can configure coverageThreshold . For example, suppose we want our tests to always fail if we don't reach at least...
Read more >How to fail a maven build, if JUnit coverage falls below certain ...
It is to fail the build based on JUnit coverage percentage for a project.It is not for the JUnit test it self. What...
Read more >Configuring Jest
It is recommended to define the configuration in a dedicated JavaScript, ... Node.js core modules, like fs , are not mocked by default....
Read more >mix test — Mix v1.12.3 - HexDocs
When a keyword list is passed, it can specify a :threshold , which is a boolean or numeric value that enables coloring of...
Read more >Test coverage visualization - GitLab Documentation
covered (green): lines which have been checked at least once by tests · no test coverage (orange): lines which are loaded but never...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for adding this. Did this make it into karma-coverage@2.0.3? I don’t think it did. Can we have it in a new release of 2.0.4?
🎉 This issue has been resolved in version 2.1.0 🎉
The release is available on:
Your semantic-release bot 📦🚀