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

[Windows] Comparison with stored snapshot fails due to line endings #11

Closed
grimsa opened this issue Feb 4, 2019 · 0 comments
Closed

Comments

@grimsa
Copy link
Collaborator

grimsa commented Feb 4, 2019

Preconditions:

  • Use default json-snapshot configuration

Steps:

  1. Run a test to create snapshot
  2. Run a test again

Expected: test passess
Actual: test fails

Symptom: in Snapshot#toMatchSnapshot rawSnapshot contains lines separated by \n, while in currentObject lines are separated by \r\n.

This generates a failure with every line being different by just the \r symbol.

Root cause: SnapshotFile constructor uses hardcoded \n (line 33)
Possible workaround: use com.fasterxml.jackson.core.util.DefaultIndenter.SYS_LF instead (both there and in SPLIT_STRING).

andrebonna added a commit that referenced this issue Feb 12, 2019
#11: Format snapshots using LF only regardless of platform
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

No branches or pull requests

2 participants