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(assert): assertObjectMatch() does not print objects correctly #5408

Closed
wants to merge 24 commits into from

Conversation

babiabeo
Copy link
Contributor

Fixes: #3472

  • Currently, when filtering arrays, assertObjectMatch() uses fn({ ...value }, { ...subset }), which converts arrays into objects. Consequently, arrays are displayed as objects. This PR adds filterArray() to handle arrays.

Fixes: #3771

  • When filtering objects, if actual and expected don't have the same keys or symbols, the fn() currently returns an empty object. It leads to missing properties if both are not empty. This PR adds logic so that it returns the keys and symbols in actual instead of an empty one. (also rename fn() to filterObject())

@babiabeo babiabeo requested a review from kt3k as a code owner July 11, 2024 05:01
Copy link

codecov bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.36%. Comparing base (3af2ed3) to head (62c21a5).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5408   +/-   ##
=======================================
  Coverage   96.35%   96.36%           
=======================================
  Files         463      463           
  Lines       37729    37789   +60     
  Branches     5568     5585   +17     
=======================================
+ Hits        36355    36415   +60     
  Misses       1332     1332           
  Partials       42       42           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@babiabeo babiabeo changed the title fix(assert): assertObjectMatch() does not print inputs correctly fix(assert): assertObjectMatch() does not print objects correctly Jul 11, 2024
@babiabeo babiabeo marked this pull request as draft July 12, 2024 03:17
@babiabeo babiabeo marked this pull request as ready for review July 12, 2024 09:32
@iuioiua iuioiua self-requested a review July 14, 2024 00:15
@iuioiua
Copy link
Contributor

iuioiua commented Jul 18, 2024

Are you able to split this into separate PRs? There are a few moving parts and I don't want to miss anything.

@babiabeo
Copy link
Contributor Author

Sure 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants