Asserts that a value has a property with the expected name, and value if provided.
Symbol
MatchersBuiltin.toHaveProperty
@param keyPath
the expected property name or path, or an index
@param value
the expected property value, if provided
expect(new Set()).toHaveProperty("size");
expect(new Uint8Array()).toHaveProperty("byteLength", 0);
expect({ kitchen: { area: 20 }}).toHaveProperty("kitchen.area", 20);
expect({ kitchen: { area: 20 }}).toHaveProperty(["kitchen", "area"], 20);