Open gbhavalkar opened 5 years ago
It seems to be work when i dont add the babel plugin But then u have to add the displayName property for every styled component for enzyme
The babel plugin isn't really working because we are not adding it to the babel config (hidden inside react-scripts
).
It is working when I eject from CRA and then add this to the babel plugins:
"plugins": [
[
"styled-components", {
"displayName": true, "fileName": false
}
]
]
The question is, whether we should eject from CRA?
The alternatives like react-app-rewired
that allow us to modify webpack/babel without ejecting do not support CRA 2.0. Just FYI!
base.configFile error when running tests using babel-plugin-styled-components Invalid presets in configuration object Link for reference : https://github.com/facebook/create-react-app/issues/5259