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

Failed test doesn't show diff when using assert.equal on an async test function #6752

Closed
sanfilippopablo opened this issue Jul 25, 2018 · 3 comments · Fixed by #6821
Closed

Comments

@sanfilippopablo
Copy link

🐛 Bug Report

When the test function returns a promise and you use assert to make the assertion, the output doesn't show the diff.

To Reproduce

Use assert in an async test function:

test('it shows diff async', async () => {
  assert.equal('hello\ngoodbye', 'hello', 'hmmm')
})

Expected behavior

It should show the diff between the expected and actual values.

Link to repl or repo (highly encouraged)

Repo reproducing bug: https://github.com/sanfilippopablo/jest-no-diff-output

Run npx envinfo --preset jest

Paste the results here:

  System:
    OS: macOS High Sierra 10.13.6
    CPU: x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
  Binaries:
    Node: 9.8.0 - /usr/local/bin/node
    Yarn: 1.3.2 - /usr/local/bin/yarn
    npm: 5.6.0 - /usr/local/bin/npm
  npmPackages:
    jest: ^23.4.1 => 23.4.1
@Diokuz
Copy link
Contributor

Diokuz commented Aug 8, 2018

I think I have the same problem. I use async expecters, and they never shows the diff.

@SimenB
Copy link
Member

SimenB commented Aug 9, 2018

PR: #6821

SimenB added a commit to SimenB/jest that referenced this issue Sep 29, 2018
@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants