diff options
Diffstat (limited to 'test/document-util.test.js')
-rw-r--r-- | test/document-util.test.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/document-util.test.js b/test/document-util.test.js index 18a5d42c..c2b2edca 100644 --- a/test/document-util.test.js +++ b/test/document-util.test.js @@ -159,12 +159,13 @@ describe('Document utility tests', () => { expect(!!imposter).toStrictEqual(!!hasImposter); const range = document.createRange(); - range.setStart(/** @type {Node} */ (imposter ? imposter : startNode), startOffset); - range.setEnd(/** @type {Node} */ (imposter ? imposter : startNode), endOffset); + range.setStart(/** @type {Node} */ (imposter ?? startNode), startOffset); + range.setEnd(/** @type {Node} */ (imposter ?? startNode), endOffset); // Override getClientRects to return a rect guaranteed to contain (x, y) range.getClientRects = () => { /** @type {import('test/document-types').PseudoDOMRectList} */ + // eslint-disable-next-line sonarjs/prefer-immediate-return const domRectList = Object.assign( [new DOMRect(x - 1, y - 1, 2, 2)], { |