diff --git a/test/browser.spec.ts b/test/browser.spec.ts index 0d06e7f6..00da218d 100644 --- a/test/browser.spec.ts +++ b/test/browser.spec.ts @@ -22,11 +22,13 @@ describe('Browser specs', function () { describe('Browser.version', function () { it('should return whether we are in headless', async () => { - const { browser, isHeadless } = getTestState(); + const { browser, isHeadless, headless } = getTestState(); const version = await browser.version(); expect(version.length).toBeGreaterThan(0); - expect(version.startsWith('Headless')).toBe(isHeadless); + expect(version.startsWith('Headless')).toBe( + isHeadless && headless !== 'chrome' + ); }); }); diff --git a/test/mocha-utils.ts b/test/mocha-utils.ts index abf80397..3b56f107 100644 --- a/test/mocha-utils.ts +++ b/test/mocha-utils.ts @@ -137,6 +137,7 @@ interface PuppeteerTestState { isFirefox: boolean; isChrome: boolean; isHeadless: boolean; + headless: string; puppeteerPath: string; } const state: Partial = {}; @@ -270,6 +271,7 @@ export const mochaHooks = { state.isFirefox = isFirefox; state.isChrome = isChrome; state.isHeadless = isHeadless; + state.headless = headless; state.puppeteerPath = path.resolve(path.join(__dirname, '..')); }, coverageHooks.beforeAll,