-
Notifications
You must be signed in to change notification settings - Fork 112
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
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters