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: type error due to customTesters in context but not in state #10

Merged
merged 1 commit into from Feb 13, 2023
Merged

fix: type error due to customTesters in context but not in state #10

merged 1 commit into from Feb 13, 2023

Conversation

justin-tay
Copy link
Contributor

Fixes #9

I think this should minimally be compatible from expect 27.5.1 which I see is used in package-lock.json.

The calling code to the matcher is

        asymmetricMatch(other) {
          const {pass} = matcher.call(
            this.getMatcherContext(),
            other,
            ...this.sample
          );
          return this.inverse ? !pass : pass;
        }

that is in jestMatchersObject in expect.

index.ts Show resolved Hide resolved
@debugmaster debugmaster merged commit 9c13e53 into debugmaster:master Feb 13, 2023
@debugmaster
Copy link
Owner

debugmaster commented Feb 13, 2023

I have upgraded the project to consume Jest 29.4. The mistake is clear in the new types.

expect.getState() returns MatcherState, but matchers require MatcherContext = MatchersState & MatcherUtils to be fully defined.

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.

TypeError: this.customTesters is not iterable in expect.jsonContaining in jest 29.4.0
2 participants