Description
🚀 Feature Proposal
When using expect(promise).resolves
or expect(promise).rejects
, and having the opposite resolution than expected, only the error message or the type of the value are being shown, hidding information. OTOH, if await
ing the Promise object and fails, full exception with its trace is being shown. I think expect(promise)
should show the full error with exception or the original value instead if receiving an unexpected resolution.
Motivation
Easier debugging, being able to have the original error object with the additional Promise related info details provided by expect(promise)
.
Example
No response
Pitch
Capture of failed Promises is already being done by Jest, I just only have the same behaviour when using expect(promise)
. Since it's returning a Promise itself, probably would make sense to put the original failed one in the cause
field of the exception.