Search code examples
node.jsmocha.jscode-coveragechainyc

How can I make C8 output total code coverage %?


I am able to generate code coverage reports using c8. enter image description here

But how do I output total coverage % every time? Currently, it outputs total coverage % only if it is less than the threshold like this. enter image description here

But I wanted to see the % every time it runs.

Config :

{
  "include": "app",
  "check-coverage": true,
  "lines": 99,
  "reporter": ["text","cobertura"]
}

Solution

  • I just needed to add "text-summary" as one of the reporters.

    "reporter": ["text","text-summary","cobertura"]