Skip to content

Enhancing the toHaveProperty matcher to support array selection - #12092

Merged
SimenB merged 8 commits into
jestjs:mainfrom
iifawzi:toHaveProperty-array-selection
Nov 29, 2021
Merged

Enhancing the toHaveProperty matcher to support array selection#12092
SimenB merged 8 commits into
jestjs:mainfrom
iifawzi:toHaveProperty-array-selection

Conversation

@iifawzi

@iifawzi iifawzi commented Nov 27, 2021

Copy link
Copy Markdown
Contributor

Summary

Hi, this PR is adding the feature requested at #7284 as mentioned #7284 (comment) to support array selection while using the toHaveProperty matcher.

Test plan

All previous matchers tests are working as expected, and I've also added more test cases to test the functionality, let me know if I need to add more tests.

@codecov-commenter

codecov-commenter commented Nov 27, 2021

Copy link
Copy Markdown

Codecov Report

Merging #12092 (794c62d) into main (2a5e515) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #12092      +/-   ##
==========================================
+ Coverage   68.89%   68.90%   +0.01%     
==========================================
  Files         324      324              
  Lines       16668    16677       +9     
  Branches     4813     4814       +1     
==========================================
+ Hits        11483    11492       +9     
  Misses       5152     5152              
  Partials       33       33              
Impacted Files Coverage Δ
packages/expect/src/matchers.ts 97.86% <100.00%> (ø)
packages/expect/src/utils.ts 96.03% <100.00%> (+0.18%) ⬆️

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 2a5e515...794c62d. Read the comment docs.

Comment thread packages/expect/src/utils.ts
@iifawzi
iifawzi force-pushed the toHaveProperty-array-selection branch from e3515c3 to 794c62d Compare November 28, 2021 11:35

@SimenB SimenB left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks!

@github-actions

Copy link
Copy Markdown

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 Dec 30, 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.

4 participants