MtoBeOneOf
Bun

method

test.Matchers.toBeOneOf

expected: Iterable<T>
): void;

Asserts that the value is deep equal to an element in the expected array.

The value must be an array or iterable, which includes strings.

@param expected

the expected value

expect(1).toBeOneOf([1,2,3]);
expect("foo").toBeOneOf(["foo", "bar"]);
expect(true).toBeOneOf(new Set([true]));
toBeOneOf<X = T>(
expected: NoInfer<Iterable<X, any, any>>
): void;