gotwarlost/istanbul — pull request #286 by tonylukasavage (2014-12-10 14:21:46+00:00)
Title: support explicit includes for cover + tests

I have a particular situation where I'd like more control over the included files filter with the `cover` command. The `cover` command has an non-configurable `fileset` filter of `['**/*.js']`. While this works in most cases, I am also trying to generate coverage reports for files in my `bin` folder, following the loose directions provided by @gotwarlost in [https://github.com/gotwarlost/istanbul/issues/97#issuecomment-25222169](https://github.com/gotwarlost/istanbul/issues/97#issuecomment-25222169). The composite report directions work, but only if I hack my local copy of istanbul and set that file filter from `['**/*.js']` to `['**/*']`.

Rather than providing a quick hack to provide an option to load all files, I added a corollary option to the `-x` excludes as `-i` for includes. It follows the same pattern and usage as `-x`, except that it allows you to explicitly define includes instead of excludes. Now if developers have Javascript files with extensions other than `.js`, which would be common in the case of testing node.js "binaries", they can specify their own include filters to have them included in the report.

Test coverage was also slightly improved by the additional testing I added to cover this. Prior to this pull request the number were:

```
Statements: 96.69%
Branches: 91%
Functions: 98.79%
Lines: 97.33%
```

With this pull request they improve to:

```
Statements: 96.74%
Branches: 91.13%
Functions: 98.79%
Lines: 97.37%
```