-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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: pass matcher context to asymmetric matchers #11926
Conversation
RawMatcherFn
with correct this
const {pass} = matcher( | ||
const {pass} = matcher.call( | ||
this.matcherState, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here's the fix - our own matchers "cheat" by not using this
but rather importing equals
etc directly
Codecov Report
@@ Coverage Diff @@
## main #11926 +/- ##
==========================================
- Coverage 68.76% 68.75% -0.01%
==========================================
Files 322 322
Lines 16591 16589 -2
Branches 4787 4786 -1
==========================================
- Hits 11408 11406 -2
Misses 5151 5151
Partials 32 32
Continue to review full report at Codecov.
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
This exposes that asymmetric matchers are not called withthis
- which IMO is a bug. For now I've stuck a@ts-ignore
there, but we should fix itAsymmetric matchers were not called with matcher context - meaning they didn't have access to
this.equals
,this.utils
etc..First commit makes TypeScript highlight that as an error, second commit fixes passing
this
.Test plan
Green CI