Add PublicApi::assert_eq_or_update(&self, snapshot_path: impl AsRef<Path>)#818
Merged
Add PublicApi::assert_eq_or_update(&self, snapshot_path: impl AsRef<Path>)#818
PublicApi::assert_eq_or_update(&self, snapshot_path: impl AsRef<Path>)#818Conversation
1dcd72e to
5adf72d
Compare
078231a to
9345246
Compare
…Path>)` We currently recommend using `insta` for snapshot testing, but unfortunately that results in very hard to read diffs. To avoid this problem, let's go back to using `.txt` files for snapshots. To help out I created a tiny new crate called `snapshot-testing`. It uses the same very nice diffing engine of `insta` but without the problematic `.snap` extension. (The `.gitattributes` workaround does not work.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We currently recommend using
instafor snapshot testing, but unfortunately that results in very hard to read diffs because of mitsuhiko/insta#425. The.gitattributesworkaround does not work. The below diff uses the workaround:To avoid this problem, let's go back to using
.txtfiles for snapshots. To help out I created a tiny new crate calledsnapshot-testing. It uses the same very nice diffing engine ofinstabut without the problematic.snapextension.Also note that we put the diffing engine behind a cargo feature so that users with their own snapshot testing library can avoid unnecessary dependencies.
To make review easier, this PR has two commits. One with the code changes and one with just the snapshots updated.