Skip to content
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

Ignore leading newlines on snapshot comparison #444

Merged
merged 3 commits into from
Feb 19, 2024
Merged

Conversation

mitsuhiko
Copy link
Owner

Previously leading whitespace caused snapshots to mismatch. This is an issue for inline snapshots where the code that removes leading indentation cannot express this properly. For now solve this by ignoring leading newlines in addition to trailing spaces which are already ignored.

Ideally future versions of the macros would inject a special character into a snapshot if leading and trailing newlines play a role.

@mitsuhiko mitsuhiko merged commit 0974fe8 into master Feb 19, 2024
12 checks passed
@mitsuhiko mitsuhiko deleted the whitespace-trim branch February 19, 2024 16:09
@mitsuhiko mitsuhiko mentioned this pull request Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant