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

expect-more-jest: Types missing from InverseAsymmetricMatchers #60

Open
thejohnfreeman opened this issue Oct 6, 2023 · 0 comments
Open

Comments

@thejohnfreeman
Copy link

I tried expect.not.toBeIso8601() as an asymmetric matcher and got this error:

error TS2339: Property 'toBeIso8601' does not exist on type 'InverseAsymmetricMatchers'.

A fix like this needs to be done for every matcher. In the meantime, this same code works as a workaround in my user code:

declare global {
  namespace jest {
    interface InverseAsymmetricMatchers {
      toBeIso8601(): any
    }
  }
}

P.S. I really appreciate this library. It gets the algebra correct and lets me reuse existing matchers (which throw errors with rich diffs) instead of making me write all-new predicates (that return boolean with no diffs) unlike jest-extended. Now I just have to get Jest to fix toHaveBeenCalledWith (and friends) to stop masking the rich diffs...

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

No branches or pull requests

1 participant