From f3f73b22e89cc27f645537dd7d40f04283838a07 Mon Sep 17 00:00:00 2001 From: Jeff Williams Date: Thu, 3 Nov 2022 14:33:43 -0700 Subject: [PATCH] feat(jsdoc-test-matchers): add `toHaveOwnProperty` matcher --- packages/jsdoc-test-matchers/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/jsdoc-test-matchers/index.js b/packages/jsdoc-test-matchers/index.js index 96691d10..8b3b1d47 100644 --- a/packages/jsdoc-test-matchers/index.js +++ b/packages/jsdoc-test-matchers/index.js @@ -30,6 +30,9 @@ addMatchers({ return valueName === otherName; }, + toHaveOwnProperty(other, value) { + return Object.hasOwn(value, other); + }, // The objects in `value` must have all of the keys and values from the corresponding objects in // `other`. The object in `value` can have additional properties as well. For example, if // `other[0]` is `{ a: 1 }`, and `value[0]` is `{ a: 1, b: 2 }`, then the objects match.