aboutsummaryrefslogtreecommitdiff
path: root/test/fixtures
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-02-10 23:12:01 -0500
committerGitHub <noreply@github.com>2024-02-11 04:12:01 +0000
commit765f1ede668f70e3af7717bf4d5f05dbf009c7f8 (patch)
treee73f481c93f8bbaa42f7c8216190fb1cb4621301 /test/fixtures
parent805cf9cb3ea744a6d7c0a5da27fc9ef4e6f08626 (diff)
Eslint rule updates (#665)
* Padding newline rules * Update rules * Update rules * Update rules * Updates * Update object quotes * Merge similar ts and js rules * Change export spacing rules * Move typescript-eslint rules * Spacing * Actually save and commit changes
Diffstat (limited to 'test/fixtures')
-rw-r--r--test/fixtures/dom-test.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/fixtures/dom-test.js b/test/fixtures/dom-test.js
index a0a17127..578b1324 100644
--- a/test/fixtures/dom-test.js
+++ b/test/fixtures/dom-test.js
@@ -43,10 +43,13 @@ function prepareWindow(window) {
export async function setupDomTest(htmlFilePath) {
const html = typeof htmlFilePath === 'string' ? fs.readFileSync(htmlFilePath, {encoding: 'utf8'}) : '<!DOCTYPE html>';
const env = builtinEnvironments.jsdom;
- const {teardown} = await env.setup(global, {jsdom: {html}});
+ const environment = await env.setup(global, {jsdom: {html}});
const window = /** @type {import('jsdom').DOMWindow} */ (/** @type {unknown} */ (global.window));
prepareWindow(window);
- return {window, teardown};
+ return {
+ window,
+ teardown: (global) => environment.teardown(global)
+ };
}
/**
@@ -59,13 +62,13 @@ export function createDomTest(htmlFilePath) {
// eslint-disable-next-line no-empty-pattern
window: async ({}, use) => {
const env = builtinEnvironments.jsdom;
- const {teardown} = await env.setup(global, {jsdom: {html}});
+ const environment = await env.setup(global, {jsdom: {html}});
const window = /** @type {import('jsdom').DOMWindow} */ (/** @type {unknown} */ (global.window));
prepareWindow(window);
try {
await use(window);
} finally {
- teardown(global);
+ environment.teardown(global);
}
}
});