Added default param and exported all methods

This commit is contained in:
jamelreid 2021-12-08 14:00:02 -05:00
parent 1f14d557dd
commit a6f51a9a39
1 changed files with 7 additions and 3 deletions

View File

@ -3,8 +3,8 @@
*/
const { E2E_RETRY_TIMES } = process.env;
const setupJestRetries = () => {
const retryTimes = E2E_RETRY_TIMES ? E2E_RETRY_TIMES : 3;
const setupJestRetries = ( retries = 2 ) => {
const retryTimes = E2E_RETRY_TIMES ? E2E_RETRY_TIMES : retries;
jest.retryTimes( retryTimes );
};
@ -13,4 +13,8 @@ const setupJestObject = () => {
setupJestRetries();
};
module.exports = setupJestObject;
module.exports = {
setupJestObject,
setupJestRetries,
};