-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
<rootDir> is not respected by collectCoverageFrom #5499
Comments
This is expected, as the docs point out it's relative to |
Ah, yeah it would be nice for consistency if Edit: after searching through the repository I guess this would be the place to strip out any rootDir usage: https://github.com/facebook/jest/blob/1947496728db13a4f271dfef8e9b9cecdcb9ee40/packages/jest-config/src/normalize.js#L130-L164 Seems easy enough at first sight :-) |
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?
I want to report a bug.
What is the current behavior?
When using
<rootDir>/foo/bar
as a value forcollectCoverageFrom
, no coverage is being collected at all.However, using
foo/bar
does work as expected.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
.Take your own config and edit (or add) your
collectCoverageFrom
field with a value that starts with<rootDir>
; then run jest with coverage enabled (yarn jest --coverage
).What is the expected behavior?
Coverage results are the same for both
<rootDir>/foo/bar
andfoo/bar
(where cwd is the root dir).Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
Yarn 1.3.2, Jest 22.2.1, ts-jest 22.0.3, Node 8.9.1.
Jest config:
The text was updated successfully, but these errors were encountered: