Added jest object setup

This commit is contained in:
jamelreid 2021-12-02 09:41:04 -05:00
parent 35286bbbe6
commit 0d2b20b309
1 changed files with 3 additions and 6 deletions

View File

@ -7,8 +7,8 @@ import {
const config = require( 'config' );
const { HTTPClientFactory } = require( '@woocommerce/api' );
const { addConsoleSuppression, updateReadyPageStatus } = require( '@woocommerce/e2e-environment' );
const { DEFAULT_TIMEOUT_OVERRIDE, E2E_RETRY_TIMES } = process.env;
const { addConsoleSuppression, updateReadyPageStatus, setupJestObject } = require( '@woocommerce/e2e-environment' );
const { DEFAULT_TIMEOUT_OVERRIDE } = process.env;
// @todo: remove this once https://github.com/woocommerce/woocommerce-admin/issues/6992 has been addressed
addConsoleSuppression( 'woocommerce_shared_settings', false );
@ -40,7 +40,7 @@ async function trashExistingPosts() {
// each other's side-effects.
beforeAll(async () => {
const retryTimes = E2E_RETRY_TIMES ? E2E_RETRY_TIMES : 3;
setupJestObject();
if ( DEFAULT_TIMEOUT_OVERRIDE ) {
page.setDefaultNavigationTimeout( DEFAULT_TIMEOUT_OVERRIDE );
@ -64,9 +64,6 @@ beforeAll(async () => {
width: 1280,
height: 800,
});
// Set how many times to retry failed tests.
jest.retryTimes( retryTimes );
});
// Clear browser cookies and cache using DevTools.