aboutsummaryrefslogtreecommitdiff
path: root/test/dom-text-scanner.test.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-12-18 22:47:29 -0500
committerGitHub <noreply@github.com>2023-12-19 03:47:29 +0000
commit46821eeb7fc9e00645aeae1c7fce3e6e7b637ca0 (patch)
tree7ed0b027946081bbc88bffefc0bfcb2c20d15106 /test/dom-text-scanner.test.js
parent521e87d01142063c785054741d3703de37a1636c (diff)
Test fixtures (#371)
* Move and rename document-test.js file * Only load HTML file content once * Move testDoc construction * Add createTranslatorTest * Add utilities * Update translator tests * Rename * Refactor anki note builder tests * Refactor * Use internal expect * Updates * Remove actual results * Remove concurrent
Diffstat (limited to 'test/dom-text-scanner.test.js')
-rw-r--r--test/dom-text-scanner.test.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/dom-text-scanner.test.js b/test/dom-text-scanner.test.js
index 76e95a09..d62e334d 100644
--- a/test/dom-text-scanner.test.js
+++ b/test/dom-text-scanner.test.js
@@ -20,7 +20,7 @@ import {fileURLToPath} from 'node:url';
import path from 'path';
import {describe, expect} from 'vitest';
import {DOMTextScanner} from '../ext/js/dom/dom-text-scanner.js';
-import {domTest} from './document-test.js';
+import {createDomTest} from './fixtures/dom-test.js';
const dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -101,9 +101,10 @@ function createAbsoluteGetComputedStyle(window) {
}
+const test = createDomTest(path.join(dirname, 'data/html/test-dom-text-scanner.html'));
+
describe('DOMTextScanner', () => {
- const testDoc = domTest(path.join(dirname, 'data/html/test-dom-text-scanner.html'));
- testDoc('Seek tests', ({window}) => {
+ test('Seek tests', ({window}) => {
const {document} = window;
window.getComputedStyle = createAbsoluteGetComputedStyle(window);