-
-
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
--projects
flag uses process.env from top level dir, not each project.
#6155
Comments
Agree, usually when you start the tests inside a project, you do it at the project root, hence We were also caught off guard when we noticed that Would you consider merging a PR that addresses that? cc @cpojer |
@mateodelnorte @robin-drexler If you call the
|
I have the same problem as @robin-drexler |
I disagree with changing the cwd automagically, this would be very unusual behavior and probably cause more confusion, not less. The |
This has caught me off guard as well, I've prepared a simple repro showcasing the problem: I would expect projects to run independently of each other - each instance/project should be independent and run exactly~ the same way as it would when jest would be run inside a particular project. IMHO this especially makes sense as the announcement post of this feature - https://jestjs.io/blog/2017/05/06/jest-20-delightful-testing-multi-project-runner#multi-project-runner-configuration-overhaul says something like:
This in my head implies that those listed projects (and their jest.config.js and relative paths in tests etc) don't have to know at all about being possibly run through this feature and shouldn't have to adjust their code to accommodate for this. It should "just work". |
Any updates on this? |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
Bump for stale bot |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
Bump for stale bot |
🐛 Bug Report
--projects
flag uses process.env from top level dir, not each project. as a result, expected paths in process.env will not match runtime behavior of projects.To Reproduce
Steps to reproduce the behavior:
Create a top level project with the following file:
Create a child project with the following file:
Expected behavior
process.env
should be recreated for each project withprocess.cwd()
set asrootDir
for that particular project.Run
npx envinfo --preset jest
The text was updated successfully, but these errors were encountered: