-
Notifications
You must be signed in to change notification settings - Fork 634
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
[feature request] assertEquals multiline string diffs #929
Comments
Do you mean something like |
@lowlighter sure, but even a normal |
I too think this would be nice to have, there's plenty of times where im wanting to assert a very large string ie help output from a cli - i have to just sift through every character and compare if the first line in the expected ends with the same character as the actual, then the same for line 2, and so on 😆 Granted i'm the on with massive strings so i brought it upon myself, but would be nice to have multiline string diffs (eg not escaping newlines or colour encoding) |
So I made a prototype for both multi-lines/words diffs which render like below: Basically if both operands are string, a custom string tokenizer is called before entering I'm not sure how to auto-switch from multi-lines diff to word-diff yet though 🤔 @ebebbington Not escaping colours seems a bit tricky, since the diff renderer currently uses colors, not sure what would be the right way to do this |
currently
assertEquals
will pretty print js object differencesbut will show multiline string diffs as a single blob
The actual diff here is pretty much unreadible so I often end up writing the changes to a file and using
git diff
or thediff
command to see the actual changes.It would be great if assertEquals could show multiline string diffs in a similar manner to
git diff
The text was updated successfully, but these errors were encountered: