You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a snapshot assertion that uses custom comparison rules fails, it will still output a unified diff of all the text changes. This diff doesn't know about the custom rules, so all the differences will be printed, including those, that did not lead to the test failure (or even no differences at all if the custom rule involved a regex).
This problem is probably impossible to solve, as custom rules depend on the structured format being used while the unified diff is only calculated on text basis. There is no way for the diff engine to know which changes where excluded from the structural comparison.
As a first step, failure message could show a warning hint in case that custom rules were used during comparison.
To solve this, we need to propagate the information about rule mismatches up to the core where we currently assemble the assertion failure. This is not that easy because currently custom rules only affect the outcome (true/false) of snapshot comparison.
The text was updated successfully, but these errors were encountered:
When a snapshot assertion that uses custom comparison rules fails, it will still output a unified diff of all the text changes. This diff doesn't know about the custom rules, so all the differences will be printed, including those, that did not lead to the test failure (or even no differences at all if the custom rule involved a regex).
This problem is probably impossible to solve, as custom rules depend on the structured format being used while the unified diff is only calculated on text basis. There is no way for the diff engine to know which changes where excluded from the structural comparison.
As a first step, failure message could show a warning hint in case that custom rules were used during comparison.
To solve this, we need to propagate the information about rule mismatches up to the core where we currently assemble the assertion failure. This is not that easy because currently custom rules only affect the outcome (true/false) of snapshot comparison.
The text was updated successfully, but these errors were encountered: