-
-
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
Jest 20 can't resolve path relative to rootDir if ran from the project root #3499
Comments
Yes this is definitely a bug. We need to spend some time fixing up the new config resolution. |
I can also add that using "moduleDirectories": [
"node_modules",
"<rootDir>/src/shared"
] also stopped working (nothing in |
I am also having similar issues where after upgrading from
After upgrading to
Rolling back to 19.0.0 makes the issue go away and my tests are found without issue. |
I was able to work around this bu duplicating
|
I also ran into this exact same problem. I had my test |
Addressed in #3538 |
Thanks @tim-mc, works for me as well 👍 |
I was able to fix mine with a simple change:
simple for me likely because my rootDir was |
@thymikee in my case |
We're still seeing this issue on |
The issue is that
I opened #3613 for that |
@bumbu yeap. Found the culprit to be this line: https://github.com/facebook/jest/blob/master/packages/jest-config/src/index.js#L50. If the path to config is passed in |
This is preventing us from upgrading past Jest 19 :( |
@evan-scott-zocdoc same thing. Have to stay on Jest 19 and just read and listen about how delightful Jest 20 experience is. |
@aaronabramov is this fixed in |
Not fixed in jest@21. |
I made some investigations and submitted a PR with explanations #4587. The issue is fixed in a PR, but it creates a new problem. I hope people subscribed to this issue could cheap in and help fix an issue with |
As a workaround for people waiting for this to be resolved, adding a |
Confirming that the issue I described above is resolved in |
This works for me too:
|
check your package.json file is setupTestFrameworkScriptFile path correct. |
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?
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
.package.json
test/config.json
test/setup.js
file is present.Example repo: https://github.com/le0nik/jest-validation-error
After getting ValidationError with jest@20 install jest@19 and the test will run.
What is the expected behavior?
Jest runs tests like it does in jest@19
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
The text was updated successfully, but these errors were encountered: