MCPcopy
hub / github.com/jestjs/jest / toHaveProperty

Method toHaveProperty

packages/expect/src/types.ts:277–277  ·  view source on GitHub ↗

* Use to check if property at provided reference keyPath exists for an object. * For checking deeply nested properties in an object you may use dot notation or an array containing * the keyPath for deep references. * * Optionally, you can provide a value to check if it's equal to the val

(
    expectedPath: string | Array<string>,
    expectedValue?: unknown,
  )

Source from the content-addressed store, hash-verified

275 * expect(houseForSale).toHaveProperty('kitchen.area', 20);
276 */
277 toHaveProperty(
278 expectedPath: string | Array<string>,
279 expectedValue?: unknown,
280 ): R;

Callers 15

args.test.tsFile · 0.80
watch.test.jsFile · 0.80
index.test.tsFile · 0.80
resolve.test.tsFile · 0.80
matchers.test.jsFile · 0.80
expect.test.tsFile · 0.80
base.test.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected