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

Optional format for string diff error messages #1351

Closed
pomber opened this issue Apr 9, 2017 · 3 comments
Closed

Optional format for string diff error messages #1351

pomber opened this issue Apr 9, 2017 · 3 comments

Comments

@pomber
Copy link

pomber commented Apr 9, 2017

Feature request:

When comparing two string with t.is(actual, expected) sometimes, when the test fails, is better to have the two strings side by side instead of showing the diff. It would be nice if this can be configured in some way.

For example:
t.is("<undefined></undefined>", "<div></div>");

Current output :

  Difference:
    "<undefinedv></undefinedv>"

Suggested output (using same output as other types use):

  Actual:

    "<undefined></undefined>"

  Must be strictly equal to:

     "<div></div>"

Or even better:

    Actual: "<undefined></undefined>"
  Expected: "<div></div>"
@novemberborn
Copy link
Member

I agree. With #1341 (pending input from others) the output would be:

Difference

- <undefined></undefined>
+ <div></div>

@novemberborn
Copy link
Member

@dudu84 we'll be solving this with #1341.

@novemberborn
Copy link
Member

#1341 has landed. A new release will be out soon.

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

No branches or pull requests

2 participants