gotwarlost/istanbul — pull request #275 by gustavnikolaj (2014-11-19 10:03:30+00:00)
Title: Include all source files in the report

I wanted to have all my source files included in the report, no matter if they were tested or not, to provide a truthful picture of the actual coverage in the test suite, without doing weird hacks.

I tried using the `--preload-sources` option, but that had the unwanted side effect that it made it seem like you had quite a bit of extra coverage, which is the result of actually `require`ing the code.

So instead I tried implementing it by instrumenting the files which have not already been visited after the report has been built, and add those. The only workaround I needed to make was to reset the count of visits on FunctionDeclarations as those were given a count of one when instrumenting, to compensate for function hoisting.

The feature is hidden behind the `--include-all-sources` flag.

I feel that this pull request covers the case of #142, in a simpler way than what you outlined in https://github.com/gotwarlost/istanbul/issues/142#issuecomment-48112469. Am I missing something?