The provided serializer currently allows us to define two options:
whether or not we want to add styling
a formatter function to transform SC classnames into something more readable
For the projects in our organisation, we would like to be able to fully strip the classNames in snapshots/storyshots. The c0 c1 don't have any added value to us and result into bloating our merge requests with meaningless changes; at worst causing unnecessary merge conflicts.
We could provide a classNameFormatter that returns null, this however leaves us with 1 whitespace per styled component class. I would like to open a PR to add a third option stripClasses which if set to true will call stripUnreferencedClassNames instead of replaceClassNames/replaceHashes. Nothing more nothing less.
For now we're using a custom package which is basically a dumbed down version of the jest-styled-components/serializerwith this feature added; but we would prefer to stick to the official tooling. Hence this feature request.
Hi there,
The provided serializer currently allows us to define two options:
For the projects in our organisation, we would like to be able to fully strip the classNames in snapshots/storyshots. The
c0 c1
don't have any added value to us and result into bloating our merge requests with meaningless changes; at worst causing unnecessary merge conflicts.We could provide a classNameFormatter that returns null, this however leaves us with 1 whitespace per styled component class. I would like to open a PR to add a third option
stripClasses
which if set totrue
will callstripUnreferencedClassNames
instead ofreplaceClassNames/replaceHashes
. Nothing more nothing less.For now we're using a custom package which is basically a dumbed down version of the
jest-styled-components/serializer
with this feature added; but we would prefer to stick to the official tooling. Hence this feature request.