custom-react-scripts icon indicating copy to clipboard operation
custom-react-scripts copied to clipboard

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

Open sunnyvempati opened this issue 8 years ago • 1 comments

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?

sunnyvempati avatar May 01 '17 17:05 sunnyvempati

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?

kitze avatar Aug 10 '17 10:08 kitze