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

Add Support for Custom Error Assertion #409

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

edmondop
Copy link

@edmondop edmondop commented Apr 3, 2024

Today the package provides Assertion helpers for errors of three type:

  • assert the observable has an error (any error)
  • assert the observable has one error
  • assert the observable has several specific errors

These assertions are useful, but could be either too broad or too narrow. Having an assertion that is very precise on the error (that returns true to a fully equality comparison) makes tests brittle, having an assertion that matches any error makes it difficult to know that the failure is right one

This PR adds an additional way to match errors through the introduction of ErrorPredicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant