setupTests.js not loading automatically in CRA react app
Update package.json.
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test setupFile ./src/setupTests.js",
"eject": "react-scripts eject"
}
Does it work when you add the following to your package.json
"scripts": {
...
"test": "react-scripts test",
...
}