verekia / js-stack-from-scratch

🛠️⚡ Step-by-step tutorial to build a modern JavaScript stack.
MIT License
20.05k stars 1.99k forks source link

jest's collectCoverageFrom #251

Open lwiecek opened 6 years ago

lwiecek commented 6 years ago

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