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

Shows object diff when an async assertion fails #370

Merged
merged 1 commit into from
Jun 27, 2019
Merged

Conversation

codefromthecrypt
Copy link
Member

Before, the assertion failure that mocha could readily interpret was
wrapped when inside an async hook. This made for very not helpful
failures.

This unwraps to prevent this.

before:

(node:70680) UnhandledPromiseRejectionWarning: AssertionError: expected { Object (http.path, http.status_code) } to deeply equal { Object (http.path, http.status_code) }

after:

  1) axios instrumentation - integration test
       should support request shorthand (defaults to GET):

      Uncaught AssertionError: expected { Object (http.path, http.status_code) } to deeply equal { Object (http.path, http.status_code) }
      + expected - actual

       {
         "http.path": "/weather/wuhan"
      -  "http.status_code": "202"
      +  "http.status_code": "2022"
       }

See mochajs/mocha#2797

Before, the assertion failure that mocha could readily interpret was
wrapped when inside an async hook. This made for very not helpful
failures.

This unwraps to prevent this.

See mochajs/mocha#2797
@codefromthecrypt codefromthecrypt merged commit 8585d41 into master Jun 27, 2019
@codefromthecrypt codefromthecrypt deleted the fix-diffs branch June 27, 2019 10:23
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

Successfully merging this pull request may close these issues.

1 participant