summaryrefslogtreecommitdiff
path: root/test/dom-text-scanner.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/dom-text-scanner.test.js')
-rw-r--r--test/dom-text-scanner.test.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/dom-text-scanner.test.js b/test/dom-text-scanner.test.js
index 6d0c047b..30aec33e 100644
--- a/test/dom-text-scanner.test.js
+++ b/test/dom-text-scanner.test.js
@@ -19,9 +19,11 @@
import fs from 'fs';
import {JSDOM} from 'jsdom';
import path from 'path';
+import {fileURLToPath} from 'node:url';
import {expect, test} from 'vitest';
import {DOMTextScanner} from '../ext/js/dom/dom-text-scanner.js';
+const dirname = path.dirname(fileURLToPath(import.meta.url));
/**
* @param {string} fileName
@@ -188,7 +190,7 @@ async function testDomTextScanner(dom) {
/** */
async function testDocument1() {
- const dom = createJSDOM(path.join(__dirname, 'data', 'html', 'test-dom-text-scanner.html'));
+ const dom = createJSDOM(path.join(dirname, 'data', 'html', 'test-dom-text-scanner.html'));
const window = dom.window;
try {
window.getComputedStyle = createAbsoluteGetComputedStyle(window);