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

Storing snapshots with line breaks preserved #2

Open
tpluscode opened this issue Jul 17, 2020 · 2 comments · May be fixed by #29
Open

Storing snapshots with line breaks preserved #2

tpluscode opened this issue Jul 17, 2020 · 2 comments · May be fixed by #29

Comments

@tpluscode
Copy link

Is it be possible to keep line breaks in the snapshots?

Current snapshot is a single line which makes them quite difficult to compare when it's a longer, multiline value.

@tlameiras
Copy link
Owner

Hi @tpluscode 👋

Can you give me an example, use case or/and data-structure where the break line is not being applied?

In the chai-snapshot-matcher-boilerplate project I have some examples (arrays and objects) where the break line is properly applied.

Thanks for your comments 🙏

@tpluscode
Copy link
Author

Just any multiline string; it gets stored as a single line with \n characters.

Of course, the library works fine but if the snapshots kept visible line breaks then diffs will be much more readable

Here's an example: https://github.com/tlameiras/chai-snapshot-matcher-boilerplate/compare/master...tpluscode:multiline?expand=1

I would like the exports["chai-snapshot-matcher - matchSapshot - stores multiline snapshots"] to actually preserve the original verbatim

@tpluscode tpluscode linked a pull request Oct 5, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants