No coverage information was collected, exit without writing coverage information.

If all your tests are under test directory then add the following in your package.json. It will run the unit tests using mocha and generates information under coverage folder.

// package.json

"scripts": {
    "coverage": "istanbul cover ./node_modules/.bin/_mocha -- ./test/**/*"

Run one of the following command depending on which version of npm, yarn you use one of them will execute the script.

 - npm run-script coverage

 - npm run coverage

 - yarn run coverage

You may also like...

1 Response

  1. Nitin Surana says:

    Thanks, worked perfect. I was using `mocha` instead of `_mocha`.

Leave a Reply

Your email address will not be published. Required fields are marked *