Asserts that an object contains at least one of the provided keys. Asserts that an object contains all the provided keys.
The value must be an object
method
Asserts that an object contains at least one of the provided keys. Asserts that an object contains all the provided keys.
The value must be an object
the expected value
expect({ a: 'hello', b: 'world' }).toContainAnyKeys(['a']);
expect({ a: 'hello', b: 'world' }).toContainAnyKeys(['b']);
expect({ a: 'hello', b: 'world' }).toContainAnyKeys(['b', 'c']);
expect({ a: 'hello', b: 'world' }).not.toContainAnyKeys(['c']);