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


If all your tests are under test direc­tory then add the fol­low­ing in your package.json. It will run the unit tests using mocha and gen­er­ates infor­ma­tion under cov­er­age folder.

// package.json

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


Run one of the fol­low­ing com­mand depend­ing on which ver­sion of npm, yarn you use one of them will exe­cute the script.

 - npm run-script coverage

 - npm run coverage

 - yarn run coverage

You may also like...