I was trying to implement the example shown in Jest website: Getting started with Jest.
While running npm test on I was getting the following error:
npm test
My issue solve with this: . If you have both react-scripts and jest in your package.json, delete jest from it. Then delete package-lock.json, yarn.lock and node_modules. Then run npm install (or yarn if you use it). ~Dan Abramov~ . issues #5119 .