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(expect): make types better reflect reality #11931

Merged
merged 2 commits into from
Oct 5, 2021
Merged

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Oct 5, 2021

Summary

Removes a couple of any and in theory allows custom MatcherStates at some point. This is something Jest itself should use. We have snapshot stuff in expect which is wrong - that's added by jest-circus and jest-jasmine. But we need to tell Jest there are potentially other states, so this is an attempt.

Test plan

Green CI (I added a couple more type tests)

@codecov-commenter
Copy link

codecov-commenter commented Oct 5, 2021

Codecov Report

Merging #11931 (1349cad) into main (02df7d3) will not change coverage.
The diff coverage is 93.33%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #11931   +/-   ##
=======================================
  Coverage   68.74%   68.74%           
=======================================
  Files         322      322           
  Lines       16587    16587           
  Branches     4786     4787    +1     
=======================================
  Hits        11403    11403           
  Misses       5152     5152           
  Partials       32       32           
Impacted Files Coverage Δ
packages/expect/src/jestMatchersObject.ts 83.78% <90.00%> (+0.92%) ⬆️
packages/expect/src/asymmetricMatchers.ts 83.05% <100.00%> (ø)
packages/expect/src/index.ts 91.78% <100.00%> (-0.12%) ⬇️

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 02df7d3...1349cad. Read the comment docs.

@SimenB
Copy link
Member Author

SimenB commented Oct 5, 2021

CI is having issues: https://www.githubstatus.com/incidents/bdbzpz7qxmbx

@SimenB SimenB merged commit 508827c into jestjs:main Oct 5, 2021
@SimenB SimenB deleted the type-expect branch October 5, 2021 15:30
@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
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.

3 participants