diff --git a/test/fixtures.spec.ts b/test/fixtures.spec.ts index 8eca362071bdf..e2c76f67231aa 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 3b56f10713e15..9593c04f9be0d 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