Skip to content

Commit

Permalink
test: skip dumpio test in non-headless modes (#8388)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed May 24, 2022
1 parent b349d71 commit f657233
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/fixtures.spec.ts
Expand Up @@ -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 = '';
Expand Down
8 changes: 8 additions & 0 deletions test/mocha-utils.ts
Expand Up @@ -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
Expand Down

0 comments on commit f657233

Please sign in to comment.