Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@rockchalkwushock
Copy link

rockchalkwushock commented Oct 3, 2017

I am using create-react-app and trying to implement this but it does not support passing jest.setupFiles in the package.json. I've been going through the jest docs but haven't found anything yet on a CLI flag for passing this information to react-scripts test. Has anyone figured this out?

@rockchalkwushock
Copy link

rockchalkwushock commented Oct 3, 2017

@pedro-mass

Thanks! Now I understand that --setupTestFrameworkScriptFile is the CLI flag as well. So thankful for --showConfig to see the underlying config being applied 🙏

@acatl
Copy link

acatl commented Oct 6, 2017

this fixed the issue for me in Jest facebook/jest#4545 (comment)

@jtrein
Copy link

jtrein commented Oct 11, 2017

Cheers, @capaj!

>$  yarn add raf --dev

// package.json
...

"jest": {
  "setupFiles": [
      "raf/polyfill"
    ]
},

...

BEFORE
screen shot 2017-10-11 at 11 49 36

AFTER
screen shot 2017-10-11 at 11 49 55

@karthickyuva
Copy link

karthickyuva commented Oct 13, 2017

@capaj, Great... 👍

// package.json

...
"setupFiles": [
"raf/polyfill"
]
...

Thanks!.. am using jest package and now its fixed my console warning
console.error node_modules/fbjs/lib/warning.js:33
Warning: React depends on requestAnimationFrame. Make sure that you load a polyfill in older browsers. http://fb.me/react-polyfills

@isaldin
Copy link

isaldin commented Oct 26, 2017

@capaj, thanks!)

@neomusic
Copy link

neomusic commented Dec 11, 2017

@capaj, Thanks!!!

@1Jesper1
Copy link

1Jesper1 commented Sep 19, 2018

@capaj, Thanks!

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