From f657233ca4babcd07f56708b84a92109755c8ee3 Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Tue, 24 May 2022 13:50:49 +0200 Subject: [PATCH] test: skip dumpio test in non-headless modes (#8388) --- test/fixtures.spec.ts | 4 ++-- test/mocha-utils.ts | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/test/fixtures.spec.ts b/test/fixtures.spec.ts index 8eca3620..e2c76f67 100644 --- a/test/fixtures.spec.ts +++ b/test/fixtures.spec.ts @@ -17,12 +17,12 @@ /* eslint-disable @typescript-eslint/no-var-requires */ import expect from 'expect'; -import { getTestState, itChromeOnly } from './mocha-utils'; // eslint-disable-line import/extensions +import { getTestState, itHeadlessOnly } from './mocha-utils'; // eslint-disable-line import/extensions import path from 'path'; describe('Fixtures', function () { - itChromeOnly('dumpio option should work with pipe option ', async () => { + itHeadlessOnly('dumpio option should work with pipe option ', async () => { const { defaultBrowserOptions, puppeteerPath } = getTestState(); let dumpioData = ''; diff --git a/test/mocha-utils.ts b/test/mocha-utils.ts index 3b56f107..9593c04f 100644 --- a/test/mocha-utils.ts +++ b/test/mocha-utils.ts @@ -158,6 +158,14 @@ export const itChromeOnly = ( else return xit(description, body); }; +export const itHeadlessOnly = ( + description: string, + body: Mocha.Func +): Mocha.Test => { + if (isChrome && isHeadless === true) return it(description, body); + else return xit(description, body); +}; + export const itFirefoxOnly = ( description: string, body: Mocha.Func