-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(assertions): object partiality is dropped passing through arrays (#…
…18525) `objectLike()` imposes partial object matching. That means that we don't need to fully specify all properties of an object to match it, but just the properties we care about (all other properties can have any value). Partial object matching is inherited. That means that in nested objects, the partiality is maintained: ```ts objectLike({ x: 'x', inner: { // Matches any object that has AT LEAST an 'y' property y: 'y', } }) ``` However, the partiality is dropped when passing through arrays: ```ts objectLike({ x: 'x', inner: [ { // Matches any object that has ONLY an 'y' property y: 'y', } ], }) ``` This is both unintuitive and different from past behavior, which makes migrating tests unnecessarily hard. Fix the discrepancy. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
2 changed files
with
33 additions
and
4 deletions.
There are no files selected for viewing
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
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