-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Coverage data was not found when using "--collectCoverageFrom" #5580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey @noelebrun, thanks for the report. This seems to be working in latest: If you truly believe this is a bug, please push a repo that we can reproduce with Otherwise we recommend using StackOverflow or our discord channel for questions You'll find more on Jest docs help page |
@noelebrun Did you solved this problem? I currently facing the same error with my typescript ts-jest setup. This is my config:
And this is the console output:
I also tried to provide My dependencies:
|
I still get the same error. node 10.0.0
|
I'll quote Rick from above 🙂
|
@SimenB Fortunately, I just pushed this repo to github this morning, you can check it here https://github.com/Tiendq/lego-part-loader :) |
@SimenB Yeah, that's exactly what we could enhance Jest :) It's definitely better to show "no test found" instead of current unclear error message. Thanks.
|
That's a separate issue though, mind opening up a new one? |
@yss14 Did you figure out a solution? I experienced a similar issue. I was able to get coverage after removing the "collectCoverageFrom" configuration block. Then I was able to put in the filters in collectCoverageFrom block. Maybe your ""./src/utils/**/*.ts"" was not pointing to the right place? Just a guess... |
It used to support this syntax in "collectCoverageFrom":
Now I need to do it in two lines:
|
@dereklin instead of |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When I'm using the Jest CLI like this:
jest --coverage --collectCoverageFrom "_path of a file_"
I get this error: Jest: Coverage data for global was not found.
My goal is to execute the coverage only on some files.
If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can
yarn install
andyarn test
.Repl.it don't seems to work, but just type
jest --coverage --collectCoverageFrom "_path of a file_"
What is the expected behavior?
Display the coverage table of the files specified by the collectCoverageFrom option.
Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
"jest": { "collectCoverage": true, "collectCoverageFrom": [ "src/**/*.js" ], "coverageThreshold": { "global": { "branches": 100, "functions": 100, "lines": 100, "statements": 0 } }, "moduleFileExtensions": [ "js" ], }
Jest 22.2.2
Node 8.9.4
yarn 1.3.2
macOS 10.13.4
Thanks!
The text was updated successfully, but these errors were encountered: