diff --git a/packages/jsdoc-test-matchers/index.js b/packages/jsdoc-test-matchers/index.js index 1daf7518..c430fbce 100644 --- a/packages/jsdoc-test-matchers/index.js +++ b/packages/jsdoc-test-matchers/index.js @@ -34,6 +34,12 @@ addMatchers({ return valueName === otherName; }, + toContainHtml(other, value) { + const otherDiffable = diffableHtml(other); + const valueDiffable = diffableHtml(value); + + return valueDiffable.includes(otherDiffable); + }, toHaveOwnProperty(other, value) { return Object.hasOwn(value, other); }, @@ -63,12 +69,6 @@ addMatchers({ return isMatch; }, - toMatchHtml(other, value) { - const otherDiffable = diffableHtml(other); - const valueDiffable = diffableHtml(value); - - return otherDiffable.includes(valueDiffable); - }, // The `value` object must have all of the keys and values from the `other` object. The `value` // object can have additional properties as well. For example, if `other` is `{ a: 1 }`, and // `value` is `{ a: 1, b: 2 }`, then the objects match.