question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

By defining threshold for coverage I don't want to fail tests but to emit warning.

See original GitHub issue

In 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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
AliF50commented, May 11, 2021

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?

0reactions
karmarunnerbotcommented, Dec 1, 2021

🎉 This issue has been resolved in version 2.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found