Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- `[jest-circus]` Better error message when a describe block is empty ([#6372](https://github.com/facebook/jest/pull/6372))
- `[jest-cli]` Fix unhandled error when a bad revision is provided to `changedSince` ([#7115](https://github.com/facebook/jest/pull/7115))
- `[jest-config]` Moved dynamically assigned `cwd` from `jest-cli` to default configuration in `jest-config` ([#7146](https://github.com/facebook/jest/pull/7146))
- `[jest-cli]` Fix watch mode filename/test name filtering is not taken into account for coverage calculation with collectCoverageFrom set ([#7153](https://github.com/facebook/jest/pull/7153))

### Chore & Maintenance

Expand Down
3 changes: 2 additions & 1 deletion packages/jest-cli/src/reporters/coverage_reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ export default class CoverageReporter extends BaseReporter {
const config = context.config;
if (
globalConfig.collectCoverageFrom &&
globalConfig.collectCoverageFrom.length
globalConfig.collectCoverageFrom.length &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also check for !config.watchAll?

Copy link
Author

@duszans duszans Oct 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rogeliog I don't think so - the watchAll is true when all files are watched in watch mode.
watch is true when there is some filtering applied, e.g. by test file name (at least in jest-cli/src/watch.js)

!globalConfig.watch
) {
context.hasteFS
.matchFilesWithGlob(globalConfig.collectCoverageFrom, config.rootDir)
Expand Down