collectCoverageFrom
collectCoverageFrom is a configuration option used by JavaScript testing tools such as Jest to determine which source files should be included when generating test coverage reports. It defines the set of files from which code coverage data will be collected, allowing developers to focus on relevant parts of the codebase.
The option accepts an array of glob patterns. Patterns can include wildcards and can be negated with
collectCoverageFrom works in tandem with collectCoverage and coverage-related settings such as coverageDirectory and coverageReporters. When collectCoverage
Typical use cases include focusing coverage on publishable source code in a library, or excluding configuration