test: skip dumpio test in non-headless modes (#8388)

This commit is contained in:
Alex Rudenko 2022-05-24 13:50:49 +02:00 committed by GitHub
parent b349d71dcd
commit f657233ca4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -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 = '';

View File

@ -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