Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Istanbul generate coverage for all of my source code?

Tags:

Currently Istanbul is only generating coverage for files that are used in my tests, which is okay, but seems to defeat the purpose of having coverage somewhat.

I have no Istanbul configuration, and am invoking it via npm test with the following script string:

$ istanbul cover _mocha -- -R dot --check-leaks --recursive test/

Is there a way to generate coverage for all of my source code?

like image 507
Seer Avatar asked Dec 22 '14 15:12

Seer


People also ask

What is Istanbul Lib coverage?

An API that provides a read-only view of coverage information with the ability to merge and summarize coverage info. Supersedes object-utils and collector from the v0 istanbul API.

How do I check my karma code coverage?

Code coverage enforcementlink To enable this, open the Karma test platform configuration file, karma. conf. js , and add the check property in the coverageReporter: key.


1 Answers

Found the answer, I think I'm partly lucky that the directory structure I have chosen allows me to use this option, but my test command is now:

$ istanbul --include-all-sources cover _mocha -- -R dot --recursive test/

The --include-all-sources is the important part.

like image 92
Seer Avatar answered Sep 21 '22 15:09

Seer