method
test.MatchersBuiltin.toContainKey
expected: IfNeverThenElse<keyof T, PropertyKey>
): void;
Asserts that an object contains a key.
The value must be an object.
@param expected
the expected value
expect({ a: 'foo', b: 'bar', c: 'baz' }).toContainKey('a');
expect({ a: 'foo', b: 'bar', c: 'baz' }).toContainKey('b');
expect({ a: 'foo', b: 'bar', c: 'baz' }).toContainKey('c');
expect({ a: 'foo', b: 'bar', c: 'baz' }).not.toContainKey('d');