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 doesn't print whole object #5498

Merged
merged 3 commits into from
Jul 21, 2024

Conversation

babiabeo
Copy link
Contributor

Separated from #5408
Fix: #3771

When filtering two objects, the fn() function returns an empty object if they don't have the same keys or symbols. This PR adds the logic so that it returns the entries of the first object in this case. (also rename fn to filterObject)

@babiabeo babiabeo requested a review from kt3k as a code owner July 20, 2024 06:58
Copy link

codecov bot commented Jul 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.30%. Comparing base (c3ccd67) to head (53636e8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5498   +/-   ##
=======================================
  Coverage   96.30%   96.30%           
=======================================
  Files         463      463           
  Lines       37660    37669    +9     
  Branches     5558     5561    +3     
=======================================
+ Hits        36267    36276    +9     
  Misses       1351     1351           
  Partials       42       42           

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

Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

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

Thanks!


// When both operands are set, build a filtered set with common values
if ((value instanceof Set) && (subset instanceof Set)) {
filtered[key] = value.intersection(subset);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice

@iuioiua iuioiua merged commit ab8f6a5 into denoland:main Jul 21, 2024
16 checks passed
@babiabeo babiabeo deleted the fix-assertObjectMatch-1 branch July 21, 2024 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assertObjectMatch doesn't print whole object in assertion error
2 participants