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 786 forks source link

Globs are not working for $ istanbul instrument -x "**glob**" #815

Open ORESoftware opened 7 years ago

ORESoftware commented 7 years ago

I am trying to do this:

public
    /lib     # this is library code (angular etc.), I want to ignore this dir
    /pages   # this is my code

Here is the command I use:

istanbul instrument public --output public-coverage -x "public/lib/**/*"

Unfortunately, the public/lib directory still gets instrumented, which is a bummer because it contains a ton of files that are 3rd party libraries which I really do not want to instrument.

I have tried every glob combination under the sun and it's not working - the lib directory and its contents never get ignored, and they are always copied over to public-coverage and instrumented.

I consistently have problems with getting globs to behave as desired...it's not just this library. Not sure why that is, but maybe people should consider other ways of ignoring dirs, etc.

guycnicholas commented 7 years ago

@ORESoftware I am finding that the option doesn't seem to work regardless where it is. I am trying to use it on an include and in the mocha section like `"coverage": "istanbul cover -i /src/*/.js -x /src/schemas/ --include-all-sources _mocha ./tests/*/.js"and what I am finding is it fails to enter any subdirectories in bothsrcandtests`. Have you noticed the same issue?

ORESoftware commented 7 years ago

@guycnicholas indeed, this is nasty stuff.. no me gusta globs