Add more data to promise matchers#490
Conversation
|
I'm not sure why did the coverage drop, the message helpers I've added are still tested by the existing tests... can anyone assist please? |
|
@SimenB any chance you can take a look? 🙏 I'd really appreciate it |
|
@harelmo I like these changes! could you rebase and fix CI? |
…ise-matchers # Conflicts: # src/matchers/toReject.js # src/matchers/toResolve.js
|
|
Merged main into this branch and updated the snapshots. It's now failing for coverage reasons. |
What
When using
toReject/toResolve, print more detailed failure reason (e.g. whentoResolvegets a rejected promise, the rejection value will be printed for easier troubleshooting (as discussed in #322 and #218)Why
Often when refactoring code tested using
toResolveortoReject, the test fails but it's unclear on why since the resolved or rejection values are not displayed as a part of the test-failure outout.This PR adds:
toResolvereceives a rejected promise.not.toResolvereceives a resolved promisetoRejectreceives a resolved promise.not.toRejectreceives a rejected promise.Notes
This does not change the beahvior of
toResolveortoRejectin any way, but only adds extra info on falitures.Housekeeping