gotwarlost / istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
8.7k stars 787 forks source link

Istanbul not covering all spec files #796

Closed hregibo closed 7 years ago

hregibo commented 7 years ago

Good day,

I am currently working on a project for which I use Istanbul to generate my code coverage reports. Using Jasmine (+node version) and Mocha/Chai, both run flawlessly even when added as Istanbul parameter, going trough all the spec files.

Yet, Istanbul is not analyzing all .spec.js files, and only handles the first file out of 3 (channel.spec.js), where the two others are not even listed in coverage report (command.spec.js and helper.spec.js).

the command I used is the following: ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha spec

Even when using the "include all sources" option, they remain as red, with 0% coverage of the spec file.

If I rename the first and only file being included on coverage (channel.spec.js -> chanel.spec-x.js to not fit the *.spec.js file requirement), it covers only the second file (command.spec.js) and so on.

The spec files are correctly requiring the sources files to test, so I am quite lost on how to fix this.

Any help is welcome!

hregibo commented 7 years ago

changed my coverage tool as the issue isnt getting any comment.