toContainAllValues

Bun

Symbol

MatchersBuiltin.toContainAllValues

toContainAllValues(expected: unknown): void

Asserts that an object contain all the provided values.

The value must be an object

@param expected

the expected value

const o = { a: 'foo', b: 'bar', c: 'baz' };
expect(o).toContainAllValues(['foo', 'bar', 'baz']);
expect(o).toContainAllValues(['baz', 'bar', 'foo']);
expect(o).not.toContainAllValues(['bar', 'foo']);