MarrayContaining
Bun

method

test.AsymmetricMatchersBuiltin.arrayContaining

arrayContaining<E = any>(
arr: readonly E[]
): any;

Matches any array made up entirely of elements in the provided array. You can use it inside toEqual or toBeCalledWith instead of a literal value.

Optionally, you can provide a type for the elements via a generic.