mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
feat(jsdoc-test-matchers): improve HTML matcher
This commit is contained in:
parent
4d24735cce
commit
4451354eee
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user