diff options
Diffstat (limited to 'test/document-util.test.js')
-rw-r--r-- | test/document-util.test.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/document-util.test.js b/test/document-util.test.js index 10857df9..51872422 100644 --- a/test/document-util.test.js +++ b/test/document-util.test.js @@ -23,7 +23,7 @@ import {DocumentUtil} from '../ext/js/dom/document-util.js'; import {DOMTextScanner} from '../ext/js/dom/dom-text-scanner.js'; import {TextSourceElement} from '../ext/js/dom/text-source-element.js'; import {TextSourceRange} from '../ext/js/dom/text-source-range.js'; -import {domTest} from './document-test.js'; +import {createDomTest} from './fixtures/dom-test.js'; const dirname = path.dirname(fileURLToPath(import.meta.url)); @@ -109,9 +109,10 @@ function findImposterElement(document) { return document.querySelector('div[style*="2147483646"]>*'); } +const test = createDomTest(path.join(dirname, 'data/html/test-document1.html')); + describe('DocumentUtil', () => { - const testDoc = domTest(path.join(dirname, 'data/html/test-document1.html')); - testDoc('Text scanning functions', ({window}) => { + test('Text scanning functions', ({window}) => { const {document} = window; for (const testElement of /** @type {NodeListOf<HTMLElement>} */ (document.querySelectorAll('.test[data-test-type=scan]'))) { // Get test parameters @@ -228,8 +229,7 @@ describe('DocumentUtil', () => { }); describe('DOMTextScanner', () => { - const testDoc = domTest(path.join(dirname, 'data/html/test-document1.html')); - testDoc('Seek functions', async ({window}) => { + test('Seek functions', async ({window}) => { const {document} = window; for (const testElement of /** @type {NodeListOf<HTMLElement>} */ (document.querySelectorAll('.test[data-test-type=text-source-range-seek]'))) { // Get test parameters |