mocha-snapshots icon indicating copy to clipboard operation
mocha-snapshots copied to clipboard

Stringify creates one line diffs

Open leggsimon opened this issue 6 years ago • 0 comments

Firstly this is great and I found this pretty easy to setup and start using. So thank you.

That being said, using JSON.stringify() when creating the snapshots creates a one line string. With larger components, this can make it impossible to see where a change has occurred since one string isn't just equal to another.

The way Jest writes the files is by writing prettified backtick strings. This allows newlines to be included in the string allowing for more readable diffs.

leggsimon avatar Sep 06 '18 11:09 leggsimon