You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases, Vitest produces a huge, unreadable diff.
Reproduction
My test is:
// generate a large HTML fileconsthtml=generateEmail(...)expect(html).toMatchSnapshot()
If the generated email does not change, the test passes. But, if the HTML changes even by a tiny bit (a single character), the Vitest diff says every single file is wrong:
So, it's useless in finding the diff. This happens for any kind of snapshots (separate file, inline). Additionally, it took me 5 hours to realize that the diffs it does find (indentation) don't actually matter and, in fact, there was a single line wrong, somewhere in the 300-line long output.
Full test - copy & paste, then run with vitest
POV: You are me. Try to figure out why the test fails.
Describe the bug
In some cases, Vitest produces a huge, unreadable diff.
Reproduction
My test is:
If the generated email does not change, the test passes. But, if the HTML changes even by a tiny bit (a single character), the Vitest diff says every single file is wrong:
So, it's useless in finding the diff. This happens for any kind of snapshots (separate file, inline). Additionally, it took me 5 hours to realize that the diffs it does find (indentation) don't actually matter and, in fact, there was a single line wrong, somewhere in the 300-line long output.
Full test - copy & paste, then run with vitest
POV: You are me. Try to figure out why the test fails.
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: