MobjectContaining
Bun

method

test.AsymmetricMatchersBuiltin.objectContaining

obj: object
): any;

Matches any object that recursively matches the provided keys. This is often handy in conjunction with other asymmetric matchers.

Optionally, you can provide a type for the object via a generic. This ensures that the object contains the desired structure.