lukeed/clsx

Snapshot test failed with auto-generated classname

cuongnvicts opened this issue · 1 comments

Hi @lukeed ,

I've had a problem with snapshot testing (Jest & @testing-library/react).
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,

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!