-
-
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
Can't find a root directory while resolving a config file path. #5595
Comments
|
Thanks, figured that after some testing and ended up putting a config into each directory. |
Just to confirm I understand this correctly - there's no way to specify the project to run via the CLI if it's configured using a single config file (e.g. in package.json, jest.config.js etc), but you can specify the test to run (but run all projects by default) by making a separate config file in each project and then referring to those in the main config file, e.g. package.json snippet
jest-test.config.js
jest-eslint.config.js
It would be nice to avoid scattering the config around like this and still be able to use |
@elyobo Correct. PR welcome for some way of specifying which of the loaded projects to run 🙂 |
I'll see if I can find some time! I went ahead and split out the config files, which works fine, it just feels like clutter :D |
Would be great to avoid duplication of identical configs in monorepos. Something like a |
Thanks for the clarification. Could you please add that same clarification to the docs? Right now, the explanation of |
Wanna send a PR for that? :) |
As requested by @SimenB in jestjs#5595, but only because he added a smiley.
As requested by @SimenB in jestjs#5595, but only because he added a smiley.
As requested by @SimenB in jestjs#5595, but only because he added a smiley.
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. |
What is the current behavior?
The test suite fails to run because it can't properly resolve the path.
Config
Execution
What is the expected behavior?
I expected that the test suite runs with the specified configuration because when I do
jest --showConfig
it shows myrootDir
as/Users/code/project
which should properly resolvetestMatch: ['**/__tests__/unit/**/*.spec.js']
to'/Users/code/project/__tests__/unit/**/*.spec.js'
.I also tried to use
<rootDir>
for thetestMatch
but the same result and it looks like it tries to resolve theunit
as a path instead of looking it up in thejest.config.js
?Am I supposed to put a
jest.config.js
into every folder and then runjest --projects tests/unit
? If that is the case then how is theprojects
option supposed to be used.Jest, node, yarn and macOS are the latest versions.
The text was updated successfully, but these errors were encountered: