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

fix: show stack traces on async assert errors #6821

Merged
merged 1 commit into from
Sep 29, 2018

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Aug 9, 2018

Summary

While jest-circus worked just like it should (🎉), jest-jasmine only checked for node assert on thrown errors, not rejected ones (from async errors).

Not sure about the best way to fix the test assertion for Circus. Failure looks like this:
image

Fixes #6752

Test plan

Test added

@SimenB
Copy link
Member Author

SimenB commented Aug 9, 2018

If the plan is to ditch jest-jasmine, I say leave it and just close this PR. If the plan is to keep jest-jasmine around for some time, we should fix this 🙂

Copy link
Collaborator

@thymikee thymikee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small change, so why not fixing that :)

@SimenB
Copy link
Member Author

SimenB commented Sep 29, 2018

Took a look, it differed because of a double-wrapping in new Error. Fixed now, will merge if CI agrees

@codecov-io
Copy link

Codecov Report

Merging #6821 into master will decrease coverage by 3.47%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6821      +/-   ##
==========================================
- Coverage   66.89%   63.41%   -3.48%     
==========================================
  Files         251      235      -16     
  Lines       10488     9116    -1372     
  Branches        4        4              
==========================================
- Hits         7016     5781    -1235     
+ Misses       3471     3334     -137     
  Partials        1        1
Impacted Files Coverage Δ
packages/jest-jasmine2/src/jasmine/Env.js 0% <0%> (ø) ⬆️
packages/jest-circus/src/index.js 57.69% <0%> (-8.98%) ⬇️
packages/jest-haste-map/src/haste_fs.js 52% <0%> (-6.63%) ⬇️
packages/jest-changed-files/src/hg.js 28.57% <0%> (-6.43%) ⬇️
packages/jest-cli/src/TestScheduler.js 38.34% <0%> (-5.93%) ⬇️
packages/jest-changed-files/src/git.js 94.59% <0%> (-5.41%) ⬇️
packages/jest-resolve-dependencies/src/index.js 97.61% <0%> (-2.39%) ⬇️
packages/jest-mock/src/index.js 87.5% <0%> (-0.78%) ⬇️
packages/jest-haste-map/src/module_map.js 87.5% <0%> (-0.74%) ⬇️
packages/jest-editor-support/src/Snapshot.js 89.09% <0%> (-0.39%) ⬇️
... and 70 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e2dac2b...a12f081. Read the comment docs.

@SimenB SimenB merged commit bf6661f into jestjs:master Sep 29, 2018
@SimenB SimenB deleted the async-assert-diff branch September 29, 2018 09:18
@github-actions
Copy link

This pull request 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 this pull request may close these issues.

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