Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: raise a nicer error when non-object errors are matched #294

Merged
merged 1 commit into from
May 13, 2024

Commits on May 13, 2024

  1. 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
    43081j committed May 13, 2024
    Configuration menu
    Copy the full SHA
    de08b55 View commit details
    Browse the repository at this point in the history