Coverage becomes unknown after adding an exclusion patter to the testMatch config option.
|-----------|----------|----------|----------|----------|-------------------|
| File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
|-----------|----------|----------|----------|----------|-------------------|
| All files | Unknown | Unknown | Unknown | Unknown | |
|-----------|----------|----------|----------|----------|-------------------|
npm installjest --coverage (should show unknown coverage)11 in package.jsonjest --coverage (should show correct coverage)Coverage report should be the same with or without the exclusion pattern.
https://github.com/g-harel/jest-7165
npx envinfo --preset jest System:
OS: Linux 4.15 Ubuntu 18.04.1 LTS (Bionic Beaver)
CPU: x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Binaries:
Node: 9.5.0 - ~/.nvm/versions/node/v9.5.0/bin/node
npm: 6.4.1 - ~/.nvm/versions/node/v9.5.0/bin/npm
npmPackages:
jest: ^23.6.0 => 23.6.0
Confirmed:

I'd like to give this one a shot, do you have any pointers?
I have a feeling it is related to the patterns being "inverted" individually instead of as a unit when removing test files from coverage recording.
@g-harel that would be great, after getting the repo running locally, I would start in the reporter here and work backward. You may end up here at some point
Thanks, that's exactly where I needed to check!
I'm still getting the exact same issue on Jest v24.3.1. Removing the exclusion pattern fixes it.
Jest config:
module.exports = {
setupFiles: ['<rootDir>/jest-env.js'],
testMatch: ['**/*.test.js', '!**/*.integ.test.js'],
testEnvironment: 'node',
verbose: true,
collectCoverage: true,
coverageReporters: ['text', 'html', 'lcov'],
coverageDirectory: 'coverage/unit',
};
Env info:
System:
OS: macOS 10.14
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Binaries:
Node: 8.10.0 - ~/.nvm/versions/node/v8.10.0/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 5.6.0 - ~/.nvm/versions/node/v8.10.0/bin/npm
npmPackages:
jest: ^24.3.1 => 24.3.1
It seems to be working correctly in g-harel/jest-7165 with v24.3.1 and the test from #7170 is also still passing. It could be a similar reason, but it doesn't look like the exact same cause.
Most helpful comment
I'm still getting the exact same issue on Jest v24.3.1. Removing the exclusion pattern fixes it.
Jest config:
Env info: