-
Notifications
You must be signed in to change notification settings - Fork 309
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
[Feature]: Add the ability to configure whether component inputs should be included in the snapshot or not. #2578
Comments
You can do |
Render |
Ah right, look at the code at
In this case, snapshot serializer can accept plugin options
With existing codes, we can have few options:
Which way would you suggest? |
I think we don't need to configure this for each test individually. With existing snapshots, we can re-generate them once. I think adding the omitAttributes option (false by default) will be the best solution. This won't ruin existing snapshots, but it will also add the ability to manually disable attributes. |
Ok I think we go with configuration on Jest level config first and see. The Jest level config most likely shares some options with serializer functions so custom matchers can also be easily supported. |
🚀 Feature Proposal
Add the ability to configure whether component inputs should be included in the snapshot or not.
Component:
Currently generated snapshot:
Expected snapshot with option:
Motivation
The
expect(fixture).toMatchSnapshot()
method always generates a snapshot with all the attributes of the component. However, when an attribute changes, it necessitates the regeneration of all snapshots. It would be beneficial to introduce an option for configuring the serializer to exclude all attributes.Example
No response
The text was updated successfully, but these errors were encountered: