Skip to content

Commit

Permalink
Show reject reason when expecting resolve (jestjs#3134)
Browse files Browse the repository at this point in the history
  • Loading branch information
robinpokorny authored and skovhus committed Apr 29, 2017
1 parent bfeaca9 commit 5fc21e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ exports[`.resolves fails for promise that rejects 1`] = `
"<dim>expect(<red>received</><dim>).resolves.toBe(<dim>)

Expected <red>received</> Promise to resolve, instead it rejected to value
<red>undefined</>"
<red>4</>"
`;

exports[`.resolves fails non-promise value "a" 1`] = `
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-matchers/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const makeResolveMatcher = (
'\n\n' +
`Expected ${utils.RECEIVED_COLOR('received')} Promise to resolve, ` +
'instead it rejected to value\n' +
` ${utils.printReceived(result)}`,
` ${utils.printReceived(e)}`,
);
}
return makeThrowingMatcher(matcher, isNot, result).apply(null, args);
Expand Down

0 comments on commit 5fc21e5

Please sign in to comment.