You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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*
0 commit comments