-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Description
🐛 Bug Report
When you run jest with --coverage but there are no tests, it shows error "Jest: Coverage data for global was not found."
To Reproduce
-
Delete all test files e.g. *.test.js
-
Run
jest --config=jest.json --coveragewith below configuration injest.json:
{
"testEnvironment": "node",
"coverageThreshold": {
"global": {
"branches": 90,
"functions": 90,
"lines": 90,
"statements": -10
}
},
"collectCoverageFrom" : [
"*.js"
]
}Expected behavior
A simple and clear error like "No tests found", or simply skipping coverage, or coverage report as usual (and failed 100%).
Link to repl or repo (highly encouraged)
https://github.com/Tiendq/lego-part-loader
Run npx envinfo --preset jest
System:
OS: macOS Sierra 10.12.6
Binaries:
Node: 10.0.0 - /usr/local/bin/node
Yarn: 1.6.0 - /usr/local/bin/yarn
npm: 5.6.0 - /usr/local/bin/npm
npmPackages:
jest: ^22.4.3 => 22.4.3