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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test setup file from cra to dev dependencies #1999

wants to merge 1 commit into
base: master


None yet
3 participants
Copy link

byCedric commented Feb 5, 2019

Hi Guys (and Girls)! We have been using this configuration for years now, so thanks for that 馃槃 I would like to propose to add the setupTests.js file from Create React App. Basically all dependencies in this exact file is used for testing. I'm not sure if this might be more relevant in the actual react eslint config, but I couldn't find this rule over there.

Hope it helps 鉂わ笍

@@ -89,6 +89,7 @@ module.exports = {
'**/Gruntfile{,.js}', // grunt config
'**/protractor.conf.js', // protractor config
'**/protractor.conf.*.js', // protractor config
'src/setupTests.js', // create react app config

This comment has been minimized.


ljharb Feb 5, 2019


i don't think it's at all a good idea to allow dev deps inside src; if that's the pattern CRA encourages, I'd suggest asking them to change it.

This comment has been minimized.


barraponto Feb 12, 2019

Agreed. CRA is doing it wrong.
In the meanwhile, @byCedric, here is how to override it for this file only:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment