-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(feat) Ignore attributes #61
Comments
A similar issue in I would extend this to "Support ignoring certain attributes" or "Allow specifying custom DOM serialization function". In our case, we need to ignore programmatically-generated |
@skozin "Support ignoring certain attributes" sounds awesome. So it can look like: {
...,
ignoreAttributes: ['style', 'class']
} |
I am using angular to prerender a static site and view encapsulation generates attributes prefixed with |
Another approach would be like |
@Vandivier what about both |
I don't think it's overkill. We would need to pick one to run first though. I imagine ignoreAttributes should run first so that if you debug ignoreFunction all other changes are already processed. |
This would be useful when working with vue components that include scoped styles. Since the framework adds a |
@talentlessguy @franciscotrillo I agree to prefer regex over an array of attribute names. The implementation could be similar to the Angular sanitizer options feature requested here: |
Similar to OP, I'm using a library ( Instead, if we have custom serializers like jest has for snapshot testing, we can write a serializer that substitutes class names with actual styles. This will be very useful when diffing snapshots that differ in styles. |
Is your feature request related to a problem? Please describe.
I have an app that is built with
styled-components
so all classNames are generated randomly.Describe the solution you'd like
Some option like
ignoreAttributes
would fit.That'd be nice to skip classNames so snapshots will work properly.
E.g. instead of this:
I would see this:
Describe alternatives you've considered
Image snapshots
The text was updated successfully, but these errors were encountered: