From 04bec14910409a2f2a93c3dce4b9cab3e89cc8bb Mon Sep 17 00:00:00 2001 From: Henrik Skupin Date: Wed, 13 Oct 2021 13:50:40 +0200 Subject: [PATCH] chore: fix lint errors --- src/node/Launcher.ts | 4 ++-- test/launcher.spec.ts | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/node/Launcher.ts b/src/node/Launcher.ts index 3c7d137da9cfc..7451753453114 100644 --- a/src/node/Launcher.ts +++ b/src/node/Launcher.ts @@ -416,9 +416,9 @@ class FirefoxLauncher implements ProductLauncher { return firefoxArguments; } - defaultPreferences(extraPrefs: { + defaultPreferences(extraPrefs: { [x: string]: unknown }): { [x: string]: unknown; - }): { [x: string]: unknown } { + } { const server = 'dummy.test'; const defaultPrefs = { diff --git a/test/launcher.spec.ts b/test/launcher.spec.ts index 5e1530190896c..6bdc84f9ab143 100644 --- a/test/launcher.spec.ts +++ b/test/launcher.spec.ts @@ -312,7 +312,11 @@ describe('Launcher specs', function () { } else if (isFirefox) { expect(puppeteer.defaultArgs()).toContain('--headless'); expect(puppeteer.defaultArgs()).toContain('--no-remote'); - expect(puppeteer.defaultArgs()).toContain('--foreground'); + if (os.platform() === 'darwin') { + expect(puppeteer.defaultArgs()).toContain('--foreground'); + } else { + expect(puppeteer.defaultArgs()).not.toContain('--foreground'); + } expect(puppeteer.defaultArgs({ headless: false })).not.toContain( '--headless' ); @@ -514,8 +518,10 @@ describe('Launcher specs', function () { async () => { const { puppeteer } = getTestState(); const consoleStub = sinon.stub(console, 'warn'); - // @ts-expect-error purposeful bad input - const browser = await puppeteer.launch({ product: 'SO_NOT_A_PRODUCT'}); + const browser = await puppeteer.launch({ + // @ts-expect-error purposeful bad input + product: 'SO_NOT_A_PRODUCT', + }); const userAgent = await browser.userAgent(); await browser.close(); expect(userAgent).toContain('Chrome');