SecretIndividual
SecretIndividual

Reputation: 2519

How to get an overview of all files in a directory using Istanbul / nyc?

I just started using nyc and Istanbul to generate a code coverage report. The fist thing I notest was that the coverage report only shows the coverage for files that are addressed in the tests. It does not show any coverage for files that are not tested at all.

If I have all my files in a directory called "src", is it possible to generate a report that includes all files in that directory (including those that have 0 tests so far)?

Currently my NPM scripts are (I am using Mocha and Chai).

"test": "mocha test/**/*.spec.js",
"nyc": "nyc --reporter=html npm test"

Upvotes: 1

Views: 2283

Answers (1)

storenth
storenth

Reputation: 1225

Try update package.json like:

"test": "mocha test/**/*.spec.js",
"coverage": "nyc --reporter=html npm test",
"nyc": {
    "all": true
}

Upvotes: 0

Related Questions