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: construct matcher context for asymmetric matchers on demand #11930

Merged
merged 2 commits into from Oct 5, 2021

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Oct 5, 2021

Summary

Following up #11926. That constructs the context when the matcher is created rather than when it's called, which is wrong (i.e. number of assertions would be wrong).

Test plan

Green CI

@@ -68,16 +68,16 @@ export const setMatchers = (

asymmetricMatch(other: unknown) {
const {pass} = matcher.call(
this.matcherState,
this.getMatcherContext(),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only real change

@codecov-commenter
Copy link

Codecov Report

Merging #11930 (f0df316) into main (f13abff) will decrease coverage by 0.00%.
The diff coverage is 93.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #11930      +/-   ##
==========================================
- Coverage   68.75%   68.74%   -0.01%     
==========================================
  Files         322      322              
  Lines       16589    16587       -2     
  Branches     4786     4786              
==========================================
- Hits        11405    11403       -2     
  Misses       5152     5152              
  Partials       32       32              
Impacted Files Coverage Δ
packages/expect/src/jestMatchersObject.ts 82.85% <66.66%> (ø)
packages/expect/src/asymmetricMatchers.ts 83.05% <100.00%> (-0.29%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f13abff...f0df316. Read the comment docs.

@SimenB SimenB merged commit 02df7d3 into jestjs:main Oct 5, 2021
@SimenB SimenB deleted the construct-matcher-context-on-demand branch October 5, 2021 14:21
@github-actions
Copy link

github-actions bot commented Nov 5, 2021

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 5, 2021
@SimenB SimenB changed the title fix: construct mather context for asymmetric matchers on demand fix: construct matcher context for asymmetric matchers on demand Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants