jest's collectCoverageFrom

Author: lwiecekCreated Dec 27, 2017Updated Dec 27, 2017

Type of issue: feature suggestion

Chapter: 02

I added the following config in my package.json:

"jest": {
    "collectCoverageFrom": [
      "src/**.{js,jsx}"
    ]
  }

I think it really helps in showing real code coverage by collecting coverage from all src files rather than only files that are being imported by tests (default behaviour).

See: https://github.com/facebook/jest/issues/1211

Source: verekia/js-stack-from-scratch