-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
jest-diff returns null if one string is multiline but the other is not #5657
Comments
I think this bug is actually worse than described. The function also returns Shouldn't it be valid to compare two single line strings? |
Actually, it looks like this behavior is intentional: But it doesn't seem expected or intuitive to me. |
The tests were added later by @pedrottimark to document the behavior. Here's a rough explanation: jest-community/snapshot-diff#27 (comment) All in all, looks like it's about time to fix this and make it right for a generic use case, not only for |
Yeah, we all agree to remove the special case. Something that has been in my slow cooker while making prerequisite changes in expect(expected).toBe(received)
- Expected
+ Received
- single_line_expected
+ single-line-received |
I think we should fix this before releasing Jest 23.
We can always improve the error message in Jest afterwards, but making |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
https://repl.it/@sompylasar/jest-diff-multiline-vs-oneline
jest-diff@22.1.0
What is the expected behavior?
The text was updated successfully, but these errors were encountered: