-
-
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
Support an "extends" option within config #3564
Comments
Bumping this as it would be extremely useful. |
Jest supports a |
@cpojer |
@cpojer May you eloborate that this is already in the .js file. I'll give my setup and how I'd like to configure it. I have "development" and "production" test configurations. The development test configurations are for the developers when developing the code. The production test configurations are for the CI pipeline tested against compiled code which will be running later on in production environments e.g. minimizing files, removing comments, removing sourcemapping etc.. I would like for the development configuration to have certain different values on just a few of the fields, hence the extend. All out configurations are written in JSON and we would like to continue to have everything in JSON. I had a look at the projects field, however I'd like to somehow define which projects to run when invoking jest. |
There are no plans to do any merging beyond |
Would be nice to support this. While using js and |
If one doesn't know, one has to write code to search for We can use |
Any chance this could be reopened @cpojer ? See my previous explanation above for why |
jest.config is not tsconfig, lmao |
But would be good if it had the same cool features. |
following up from #11399:
❌ This still seems to be the case with presets
✔️ This is not the case, from a deeply nested package I am pointing to a file at the root and it's working
✔️ All of my files are
✔️ I am using a relative path, e.g.
♻️ From reading the changelog, it seems like there has been some work on this like #9027 and #5505 so it's at least partially done (both of which were opened some time after this PR). |
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?
New feature.
What is the current behavior?
It does not exist. Perhaps it can replace
preset
?What is the expected behavior?
Currently, we have a
preset
configuration option that allows us to extend a pre-defined configuration from an NPM package. This works for the most part, but is quite lacking in functionality, specifically:jest-preset.json
to exist in an NPM package.jest-preset.config.js
) or JSON5 files (jest-preset.json5
).My proposal is to support all the above mentioned, similar to
babel
oreslint
.A few examples:
.json
or.json5
, parse it with JSON5. If it ends with.js
, simplyrequire
it and use the exported object.Why the feature request?
I would like to extend the react-native preset, as well as my personal preset, but I currently cannot do this. This proposal also aligns the build tool with other existing build tools.
If this is a valid feature request, I can look into submitting a PR.
The text was updated successfully, but these errors were encountered: