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

Use optional chaining in toHaveLength matcher #9826

Merged
merged 1 commit into from
Apr 16, 2020

Conversation

MajorBreakfast
Copy link
Contributor

Simplifies the check using optional chaining. Maybe the code can be simplified even further omitting the string check as well. WDYT?

Relates to #9796

cc @G-Rath @SimenB

Copy link
Contributor

@G-Rath G-Rath left a comment

Choose a reason for hiding this comment

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

Sure - I mean the original check worked, and was technically smaller due to optional chaining needing to be transpiled, but yup this is slightly simpler.

👍

@codecov-io
Copy link

Codecov Report

Merging #9826 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9826      +/-   ##
==========================================
+ Coverage   64.89%   64.91%   +0.01%     
==========================================
  Files         289      289              
  Lines       12233    12232       -1     
  Branches     3032     3029       -3     
==========================================
+ Hits         7939     7940       +1     
+ Misses       3654     3653       -1     
+ Partials      640      639       -1     
Impacted Files Coverage Δ
packages/expect/src/matchers.ts 96.85% <100.00%> (-0.02%) ⬇️
packages/expect/src/utils.ts 96.22% <0.00%> (+1.25%) ⬆️

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 4010fdd...343a69d. Read the comment docs.

@SimenB SimenB merged commit 2a92e7f into jestjs:master Apr 16, 2020
@SimenB
Copy link
Member

SimenB commented Apr 16, 2020

Thanks!

@github-actions
Copy link

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 May 11, 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.

5 participants