kitze / custom-react-scripts

[DEPRECATED, use customize-cra] Allow custom config for create-react-app without ejecting
https://custom-react-scripts.netlify.com
MIT License
991 stars 96 forks source link

Using identity-obj-proxy for snapshot testing with CSS Modules #77

Open sunnyvempati opened 7 years ago

sunnyvempati commented 7 years ago

The template that's generated from snapshot tests has the CSS classnames as unknown. After doing a little bit of research, it looks like the easiest way to solve this is by using identity-obj-proxy.

I'm curious on how others are solving this issue if using snapshot testing for components.

If this is the only solution, I can create a PR that adds the following:

"moduleNameMapper": {
  "^.+\\.(css|scss)$": "identity-obj-proxy"
}

@kitze thoughts?

kitze commented 7 years ago

I have no idea @sunnyvempati. I just released a new version of custom-react-scripts, can you try if it works without adding any config?