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

exclude file only exluding one file when using glob #800

Open gjuchault opened 7 years ago

gjuchault commented 7 years ago

Hi,

When using the -x option with glob, it only exlude one file.

$ ls scripts
device.js seed.js ssl.js test.js
$ ./node_modules/.bin/istanbul cover ./scripts/test.js -x ./scripts/**/*.js -v
Using configuration
-------------------
verbose: true
instrumentation:
    root: .
    extensions:
        - .js
    default-excludes: true
    excludes:
        - ./scripts/device.js

If I use multiple -x files for each file, it will work. If I use multiple -x ./scripts/**/*.js, it adds more ./scripts/device.js to the excludes list