Istanbul: Documentation for --include-all-sources

Created on 17 Feb 2017  路  4Comments  路  Source: gotwarlost/istanbul

Hi all! Sorry looks like you get inundated with requests here

The distinction represented by switching --include-all-sources on and off seems really important. A simple discussion of what this switch is for would be really nice. Maybe I missed it in the docs, but I assume what it does is compare covered lines against all the .js files in project; whereas if the switch is off, then istanbul would only compare coverage against .js files that were actually invoked.

I assume my observation is correct, but is there a good place to read about this? thanks

Most helpful comment

$ istanbul help yields:

Usage: istanbul help config | <command>

`config` provides help with istanbul configuration

Available commands are:

      check-coverage
              checks overall/per-file coverage against thresholds from coverage
              JSON files. Exits 1 if thresholds are not met, 0 otherwise


      cover   transparently adds coverage information to a node command. Saves
              coverage.json and reports at the end of execution


      help    shows help


      instrument
              instruments a file or a directory tree and writes the
              instrumented code to the desired output location


      report  writes reports for coverage JSON objects produced in a previous
              run


      test    cover a node command only when npm_config_coverage is set. Use in
              an `npm test` script for conditional coverage


Command names can be abbreviated as long as the abbreviation is unambiguous
istanbul version:0.4.5

which does't explain --include-all-sources

All 4 comments

$ istanbul help yields:

Usage: istanbul help config | <command>

`config` provides help with istanbul configuration

Available commands are:

      check-coverage
              checks overall/per-file coverage against thresholds from coverage
              JSON files. Exits 1 if thresholds are not met, 0 otherwise


      cover   transparently adds coverage information to a node command. Saves
              coverage.json and reports at the end of execution


      help    shows help


      instrument
              instruments a file or a directory tree and writes the
              instrumented code to the desired output location


      report  writes reports for coverage JSON objects produced in a previous
              run


      test    cover a node command only when npm_config_coverage is set. Use in
              an `npm test` script for conditional coverage


Command names can be abbreviated as long as the abbreviation is unambiguous
istanbul version:0.4.5

which does't explain --include-all-sources

I'm also interested to learn more about the --include-all-sources flag.

Specifically, if I can use something more like --include-sources src to only include my src folder.

Seems it's from a pull request a long time ago: https://github.com/gotwarlost/istanbul/pull/275

Found my answer here: https://github.com/gotwarlost/istanbul/issues/112#issuecomment-281078341

Just needed to run with the --root flag: --include-all-sources --root ./src.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mbielski picture mbielski  路  37Comments

schulzch picture schulzch  路  151Comments

amoufaddel picture amoufaddel  路  28Comments

lizhexia picture lizhexia  路  60Comments

ouhouhsami picture ouhouhsami  路  16Comments