diff options
Diffstat (limited to 'test/dom-text-scanner.test.js')
-rw-r--r-- | test/dom-text-scanner.test.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/dom-text-scanner.test.js b/test/dom-text-scanner.test.js index da38d24c..12e3193a 100644 --- a/test/dom-text-scanner.test.js +++ b/test/dom-text-scanner.test.js @@ -18,10 +18,10 @@ import {fileURLToPath} from 'node:url'; import path from 'path'; -import {describe, expect} from 'vitest'; +import {afterAll, describe, expect, test} from 'vitest'; import {parseJson} from '../dev/json.js'; import {DOMTextScanner} from '../ext/js/dom/dom-text-scanner.js'; -import {createDomTest} from './fixtures/dom-test.js'; +import {setupDomTest} from './fixtures/dom-test.js'; const dirname = path.dirname(fileURLToPath(import.meta.url)); @@ -101,11 +101,13 @@ function createAbsoluteGetComputedStyle(window) { }; } - -const test = createDomTest(path.join(dirname, 'data/html/dom-text-scanner.html')); +const domTestEnv = await setupDomTest(path.join(dirname, 'data/html/dom-text-scanner.html')); describe('DOMTextScanner', () => { - test('Seek tests', ({window}) => { + const {window, teardown} = domTestEnv; + afterAll(() => teardown(global)); + + test('Seek tests', () => { const {document} = window; window.getComputedStyle = createAbsoluteGetComputedStyle(window); |