create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

Add Jest configuration for snapshotresolver

Open akuji1993 opened this issue 5 years ago • 20 comments

As I understand, right now CRA only supports a handful of Jest configuration overrides, either by adding them to package.json or adding a jest.config.js to your project.

First question would be, why are you not allowing to just add a jest.config.js and read all of the configuration variables that Jest provides usually, why add just a few of them?

And the more important suggestion, can you add snapshotresolver to this list of allowed customizations? https://jestjs.io/docs/en/configuration#snapshotresolver-string

It has been added with Jest 24 and would really help clean up the codebase a bit, since I don't think it's necessary to have generated code right next to my .tsx, .scss and .test.ts files.. If not, could you at least explain, how the decision was made to not just check for a jest.config.js and then give it to the test runner, so the dev can decide what they want to override or not.

akuji1993 avatar Feb 27 '19 09:02 akuji1993

This functionality would be really useful.

avaleriani avatar Mar 13 '19 10:03 avaleriani

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

stale[bot] avatar Apr 12 '19 10:04 stale[bot]

I'd really like to have a reaction to this.

akuji1993 avatar Apr 12 '19 14:04 akuji1993

Was about to open this issue, but was happy to find it here already! Similar to #3116, this could be a pretty simple fix.

jareware avatar May 03 '19 13:05 jareware

I just checked the source code and this shouldn't be hard to implement. I will try to put together a pull request for this, should be a no brainer.

akuji1993 avatar May 03 '19 14:05 akuji1993

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

stale[bot] avatar Jun 02 '19 15:06 stale[bot]

Bumping to avoid staleness; still very much looking forward to a solution!

jareware avatar Jun 04 '19 08:06 jareware

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

stale[bot] avatar Jul 04 '19 08:07 stale[bot]

Still interested!

jareware avatar Jul 09 '19 08:07 jareware

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

stale[bot] avatar Aug 08 '19 09:08 stale[bot]

Hopefully I did everything right, this is my first PR into any large repository.

akuji1993 avatar Aug 09 '19 14:08 akuji1993

Is there any opposition from the CRA team to allowing all options specified in a jest.config.js file to be used and override the defaults? I don't see the harm.

jamesopti avatar Dec 18 '19 19:12 jamesopti

any news about this?

orlandovallejos avatar Mar 27 '20 15:03 orlandovallejos

Nobody seems to look at the Merge Request.

akuji1993 avatar Mar 27 '20 15:03 akuji1993

Is there any work around for getting this to work with CRA (without the PR)?

philwindsor avatar Apr 24 '20 14:04 philwindsor

didnt it go ahead? It'd be very very useful!!!

efranca avatar Oct 14 '20 12:10 efranca

Still interested in this - any update on when it will be added?

ksk385 avatar Mar 04 '21 16:03 ksk385

It seems like the PR has been tagged as an enhancement :( It'll be so soon

jslmariano avatar Jul 22 '21 07:07 jslmariano

I was going to do the same PR until I stumbled on this, it really should be merged, a nice feature to add, and a well-needed one to make folders structure neater.

DjellalAbdou avatar Feb 17 '22 16:02 DjellalAbdou

Any maintainer feedback on this on?

sullrich84 avatar Jul 26 '22 17:07 sullrich84

any support in the future for this feature request?

billwatson017 avatar Dec 05 '22 20:12 billwatson017