From 2da866f982930c76d2317a3be426410683ecf5a2 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Mon, 19 Feb 2024 07:30:17 -0500 Subject: Update eslint rules (#710) --- test/playwright/integration.spec.js | 2 +- test/playwright/playwright-util.js | 8 ++++---- test/playwright/visual.spec.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'test/playwright') 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|undefined} + * @returns {Promise} */ -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}) => { -- cgit v1.2.3