jest-extended icon indicating copy to clipboard operation
jest-extended copied to clipboard

Output rejected / resolved value when matcher failed

Open rluvaton opened this issue 3 years ago • 1 comments

Feature request:

When using .toResolve or .toReject and the promise doesn't settle as we expected we see the error:

Expected promise to resolve but rejected instead

(This error is not the exact error that outputted but it goes something like that)

But when a promise resolved/rejected when it shouldn't it would be helpful to output the promise result so we can now why it rejected/resolved

So maybe the new error message will be something like:

Expected promise to resolve but rejected instead with value:

I can create a PR for this if wanted

rluvaton avatar May 27 '21 13:05 rluvaton

I can create a PR for this if wanted That would be a great improvment!

ChristianSchwarz avatar Oct 08 '21 11:10 ChristianSchwarz