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

No coverage information when using multiple extensions #722

Open asgoth opened 7 years ago

asgoth commented 7 years ago

No coverage information is gathered when using multiple extensions. Seems related with https://github.com/gotwarlost/istanbul/pull/673.

I am using multiple extensions for having coverage information for node script files, e.g. my-node-script:

#!/usr/bin/env node
...

Relevant config in .istanbul.yml:

instrumentation:
  root: .
  extensions:
    - .js
    - my-node-script

This still worked on version 0.4.4 and is broken on version 0.4.5

asgoth commented 7 years ago

Maybe use globby or glob-stream instead of glob?

speed-of-light commented 7 years ago

same here when set -e .ts

SGD1953 commented 7 years ago

I can confirm the issue (thanks for reporting it)!

Single extension works with 0.4.5 while adding a second will result into No coverage information was collected, exit without writing coverage information. Downgrading to 0.4.4 fixed the issue.