Updated jest.retryTimes() to be a conditional

This way it doesn't matter if the call is made locally or from the package.
This commit is contained in:
jamelreid 2021-12-14 13:14:41 -05:00
parent ac83762aca
commit 6dcab53871
1 changed files with 3 additions and 1 deletions

View File

@ -6,7 +6,9 @@ const { E2E_RETRY_TIMES } = process.env;
const setupJestRetries = ( retries = 0 ) => {
const retryTimes = E2E_RETRY_TIMES ? E2E_RETRY_TIMES : retries;
jest.retryTimes( retryTimes );
if ( retryTimes > 0 ) {
jest.retryTimes( retryTimes );
}
};
// If more methods are added to setupJestObject, it should be include in the readme