MtoContainEqual
Bun

method

test.MatchersBuiltin.toContainEqual

expected: T extends Iterable<U, any, any> ? U : T
): void;

Asserts that a value contains and equals what is expected.

This matcher will perform a deep equality check for members of arrays, rather than checking for object identity.

@param expected

the expected value

expect([{ a: 1 }]).toContainEqual({ a: 1 });
expect([{ a: 1 }]).not.toContainEqual({ a: 2 });
expected: NoInfer<X extends Iterable<U, any, any> ? U : X>
): void;