aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-02-19 07:30:17 -0500
committerGitHub <noreply@github.com>2024-02-19 12:30:17 +0000
commit2da866f982930c76d2317a3be426410683ecf5a2 (patch)
treee77ce545177ba398068cb63037096a56dea04e2c /test
parent65fa65fc7765bc9a6557d3ce6f8bdcef5b5e0cf7 (diff)
Update eslint rules (#710)
Diffstat (limited to 'test')
-rw-r--r--test/data/html/js/html-test-utilities.js16
-rw-r--r--test/fixtures/dom-test.js2
-rw-r--r--test/playwright/integration.spec.js2
-rw-r--r--test/playwright/playwright-util.js8
-rw-r--r--test/playwright/visual.spec.js2
5 files changed, 15 insertions, 15 deletions
diff --git a/test/data/html/js/html-test-utilities.js b/test/data/html/js/html-test-utilities.js
index c3382456..34e58807 100644
--- a/test/data/html/js/html-test-utilities.js
+++ b/test/data/html/js/html-test-utilities.js
@@ -26,38 +26,38 @@ class HtmlTestUtilities {
*/
static requestFullscreen(element) {
if (element.requestFullscreen) {
- element.requestFullscreen();
+ void element.requestFullscreen();
// @ts-expect-error - Browser compatibility
} else if (element.mozRequestFullScreen) {
// @ts-expect-error - Browser compatibility
- element.mozRequestFullScreen();
+ void element.mozRequestFullScreen();
// @ts-expect-error - Browser compatibility
} else if (element.webkitRequestFullscreen) {
// @ts-expect-error - Browser compatibility
- element.webkitRequestFullscreen();
+ void element.webkitRequestFullscreen();
// @ts-expect-error - Browser compatibility
} else if (element.msRequestFullscreen) {
// @ts-expect-error - Browser compatibility
- element.msRequestFullscreen();
+ void element.msRequestFullscreen();
}
}
/** */
static exitFullscreen() {
if (document.exitFullscreen) {
- document.exitFullscreen();
+ void document.exitFullscreen();
// @ts-expect-error - Browser compatibility
} else if (document.mozCancelFullScreen) {
// @ts-expect-error - Browser compatibility
- document.mozCancelFullScreen();
+ void document.mozCancelFullScreen();
// @ts-expect-error - Browser compatibility
} else if (document.webkitExitFullscreen) {
// @ts-expect-error - Browser compatibility
- document.webkitExitFullscreen();
+ void document.webkitExitFullscreen();
// @ts-expect-error - Browser compatibility
} else if (document.msExitFullscreen) {
// @ts-expect-error - Browser compatibility
- document.msExitFullscreen();
+ void document.msExitFullscreen();
}
}
diff --git a/test/fixtures/dom-test.js b/test/fixtures/dom-test.js
index 961e0a77..459383cc 100644
--- a/test/fixtures/dom-test.js
+++ b/test/fixtures/dom-test.js
@@ -69,7 +69,7 @@ export function createDomTest(htmlFilePath) {
try {
await use(window);
} finally {
- environment.teardown(global);
+ await environment.teardown(global);
}
}
});
diff --git a/test/playwright/integration.spec.js b/test/playwright/integration.spec.js
index 06af3fd2..4957b676 100644
--- a/test/playwright/integration.spec.js
+++ b/test/playwright/integration.spec.js
@@ -51,7 +51,7 @@ test('anki add', async ({context, page, extensionId}) => {
resolve = res;
});
await context.route(/127.0.0.1:8765\/*/, (route) => {
- mockAnkiRouteHandler(route);
+ void mockAnkiRouteHandler(route);
const req = route.request();
if (req.url().includes('127.0.0.1:8765') && req.postDataJSON().action === 'addNote') {
/** @type {(value: unknown) => void} */ (resolve)(req.postDataJSON());
diff --git a/test/playwright/playwright-util.js b/test/playwright/playwright-util.js
index b9a4831a..653112c6 100644
--- a/test/playwright/playwright-util.js
+++ b/test/playwright/playwright-util.js
@@ -68,16 +68,16 @@ export const mockModelFieldsToAnkiValues = {
/**
* @param {import('playwright').Route} route
- * @returns {Promise<void>|undefined}
+ * @returns {Promise<void>}
*/
-export const mockAnkiRouteHandler = (route) => {
+export async function mockAnkiRouteHandler(route) {
const reqBody = route.request().postDataJSON();
const respBody = ankiRouteResponses[reqBody.action];
if (!respBody) {
return route.abort();
}
- route.fulfill(respBody);
-};
+ await route.fulfill(respBody);
+}
/**
* @param {import('playwright').Page} page
diff --git a/test/playwright/visual.spec.js b/test/playwright/visual.spec.js
index 157cedc7..579c2d0b 100644
--- a/test/playwright/visual.spec.js
+++ b/test/playwright/visual.spec.js
@@ -22,7 +22,7 @@ import {expect, root, test} from './playwright-util.js';
test.beforeEach(async ({context}) => {
// Wait for the on-install welcome.html tab to load, which becomes the foreground tab
const welcome = await context.waitForEvent('page');
- welcome.close(); // Close the welcome tab so our main tab becomes the foreground tab -- otherwise, the screenshot can hang
+ await welcome.close(); // Close the welcome tab so our main tab becomes the foreground tab -- otherwise, the screenshot can hang
});
test('visual', async ({page, extensionId}) => {