alivenotions / pidpod

A friendly podcast player
MIT License
0 stars 0 forks source link

Error when running tests using styled-components babel plugin #11

Open gbhavalkar opened 5 years ago

gbhavalkar commented 5 years ago

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

gbhavalkar commented 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

alivenotions commented 5 years ago

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?

alivenotions commented 5 years ago

The alternatives like react-app-rewired that allow us to modify webpack/babel without ejecting do not support CRA 2.0. Just FYI!