-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Adjust force-update on inline snapshots to only view within the string #581
Adjust force-update on inline snapshots to only view within the string #581
Conversation
7d8220b
to
a1880f0
Compare
OK, I think this is in a pretty good state now — again, more changes than ideal — but I think moving the library to be simpler, fewer corners (+ with #563 we'll separate out any legacy snapshot normalizations, will be good) |
@mitsuhiko this one is top of my list for you to review when you get the chance to review things; think it's a much better experience for users; somewhat to your point when merging the PR that enabled forcing inline snapshot updates |
@mitsuhiko I think the benefits of this are large enough, and I would like to minimize conflicts with #489, that it's worth me merging without waiting longer for a review. The main drawback is potentially one of performance — the current code does many more allocations, albeit in non-perf-sensitive code. I recognize you gave me merge permissions with the understanding I would be careful, so:
|
Stacks on #581, merge that first Now that we've consolidated the checks for whether to write snapshots into `matches_fully`, I think we can remove the check on whether the file contents match.
This solves the issue in #573 for the moment:
--force-update-snapshots
in passed, we only update inline snapshots when there's some difference within the string, such as an additional linebreak at the start or the end--force-update-snapshots
without--accept
#573 (comment)It's a decent number of changes, but will integrate nicely with #563.
(FYI we currently don't look at the indentation, but we could adjust this)Now indentation works too