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?
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With