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

jestDiff() call in toWarnDev() returns null, making test failure confusing #12427

Closed
gaearon opened this issue Mar 22, 2018 · 2 comments
Closed

Comments

@gaearon
Copy link
Collaborator

gaearon commented Mar 22, 2018

screen shot 2018-03-22 at 4 47 40 pm

Caused by this line:

jestDiff(normalizedMessage, expectedMessages[0]);

Calling jestDiff with two different strings returns null.

@bvaughn
Copy link
Contributor

bvaughn commented Mar 26, 2018

I don't think the bug description is correct:

Calling jestDiff with two different strings returns null.

Documentation for jest-diff says:

Generate a string that will highlight the difference between two values with green and red. (similar to how github does code diffing)

The problem we seem to be seeing is caused by this line. It looks like jest-diff just fails to handle single-line strings?

I'm not sure why they check the multiline case like they do. To me, it looks like the return value in all cases should be return diffStrings(a, b, options);

@bvaughn
Copy link
Contributor

bvaughn commented Mar 26, 2018

Related Jest issue jestjs/jest#5657

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants