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

Show reject reason when expecting resolve #3134

Merged
merged 1 commit into from
Mar 13, 2017

Conversation

robinpokorny
Copy link
Contributor

Summary

Fixes the message when a promise was expected to be fulfilled but was rejected.

await jestExpect(Promise.reject(4)).resolves.toBe(4);
- Expected received Promise to resolve, instead it rejected to value undefined
+ Expected received Promise to resolve, instead it rejected to value 4

This was overlooked in #3068.

Test plan

The snapshot covers this.

@codecov-io
Copy link

Codecov Report

Merging #3134 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #3134   +/-   ##
=======================================
  Coverage   69.31%   69.31%           
=======================================
  Files         157      157           
  Lines        5560     5560           
  Branches        3        3           
=======================================
  Hits         3854     3854           
  Misses       1705     1705           
  Partials        1        1
Impacted Files Coverage Δ
packages/jest-matchers/src/index.js 95.23% <ø> (ø)

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 21d9043...33b168e. Read the comment docs.

@cpojer cpojer merged commit 2c98557 into jestjs:master Mar 13, 2017
@robinpokorny robinpokorny deleted the fix-resolves-error-message branch March 14, 2017 07:12
skovhus pushed a commit to skovhus/jest that referenced this pull request Apr 29, 2017
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
@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 13, 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.

4 participants