lukeed/clsxPublic

A tiny (239B) utility for constructing `className` strings conditionally.

Snapshot test failed with auto-generated classname

CU

Hi @lukeed ,

I've had a problem with snapshot testing (Jest & [@testing-library/react](https://testing-library.com/docs/react-testing-library/intro)). When I run test twice with `toMatchSnapshot()`, the new snapshot was be different from the old one because of auto-generated classname. Example as:

``` data-tableid="022204747978025785"

data-tableid="043447615246065774" ``` I have researched a lot but haven't found how to pass this issue. Do you have any suggestions for me in this case?

Thanks,

  1. lukeedmentioned6 years ago on GitHub

  2. lukeedsubscribed6 years ago on GitHub

  3. LU

    Hey, sorry this has nothing to do with clsx. Will be closing this, but I think you need to look at using `identify-obj-proxy` in your config. That would certainly help with something like CSS Modules, but I have zero idea what `data-tableid` is or what that has to do with clsx.

    Good luck!

  4. lukeedclosed6 years ago on GitHub