7

I am currently using Karma's coverage within a project, I would like to enforce a threshold for the coverage to be set at and therefore make my builds on Circle CI to fail and go red due to it being lower than a set percentage.

Nick White
  • 1,602
  • 4
  • 20
  • 35

1 Answers1

7

You can install karma-threshold-reporter and configure it as shown in the README.

Svante
  • 50,694
  • 11
  • 78
  • 122
  • A short eight and a half years later , the [repo](https://github.com/lithiumtech/karma-threshold-reporter) and [site](https://github.com/lithiumtech/karma-threshold-reporter) are kaput. Any other good options? ([This](https://github.com/karma-runner/karma-coverage/blob/master/docs/configuration.md#check) might be useful.) – ruffin May 26 '23 at 17:40
  • https://github.com/karma-runner/karma-coverage/blob/master/docs/configuration.md#check was posted three years ago, but deleted because it was only a link -_-. I guess it's a problem of the question, but nevertheless I don't see better ways to ask or answer, and since web search is increasingly broken nowadays (enshittification) … – Svante Jun 05 '23 at 11:38