-
Notifications
You must be signed in to change notification settings - Fork 629
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…/deno_std into fix-assert-object-match
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
babiabeo
changed the title
fix(assert):
fix(assert): Jul 11, 2024
assertObjectMatch()
does not print inputs correctlyassertObjectMatch()
does not print objects correctly
Are you able to split this into separate PRs? There are a few moving parts and I don't want to miss anything. |
Sure 👍 |
This was referenced Jul 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #3472
assertObjectMatch()
usesfn({ ...value }, { ...subset })
, which converts arrays into objects. Consequently, arrays are displayed as objects. This PR addsfilterArray()
to handle arrays.Fixes: #3771
actual
andexpected
don't have the same keys or symbols, thefn()
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 inactual
instead of an empty one. (also renamefn()
tofilterObject()
)