Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: raise a nicer error when non-object errors are matched
When a promise is rejected, we currently incorrectly assume the rejection reason is an object consumable by check-error (i.e. an `Error` or similar). This change basically checks strict equality on the matcher and the thrown error first (such that `rejectedWith(undefined)` would work). It then falls back to the original logic only if both the matcher and the reason are truthy. Fixes #263
- Loading branch information