-
-
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
Add an option for config file path in package.json #8134
Comments
Having Linking in #7185 |
Thanks |
Has this been implemented yet? |
Hello, any news on this ? my jest config file is not in the root directory but inside tests/unit, and it's annoying. |
For me, adding the preset field to my package.json seems to have worked to do exactly that. It made my custom config file globally accessible for all npm scripts as well as IDE-initiated tests, which previously used to fail unless I manually specified where jest.config was located. "jest": {
"preset": "./config/jest/jest.config.mjs"
} |
Thanks @D-Pow this was exactly what I needed to get WebStorm to use my config for default run configurations |
Thanks @D-Pow for the hint. I resolve this issue. |
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. |
🚀 Feature Proposal
For now, when we want to configure jest we have three choices :
package.json
jest.config.js
at rootIn both this previous choices, you can easily run your tests with a simple
jest
command.whatYouWant.js
anywhere in your projectWith this last choice you have to run
jest -c ./path/to/whatYouWant.js
Motivation
The idea is to run a simple
jest
command in any of the three cases.Example
The idea should be to add a new option in
package.json
. It may be something likedefaultConfigFile
:In this case, it's the only option in
package.json
, which override the default config file search at root. The rest of the config stays in yourwhatYouWant.js
Pitch
Why does this feature belong in the Jest core platform?
Because it's a native configuration proposal.
The text was updated successfully, but these errors were encountered: