Skip to content

Commit

Permalink
fix: typo in retries env var
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent committed Nov 30, 2023
1 parent c286f42 commit ef39e9b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/helper/Playwright.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ class Playwright extends Helper {
async _before(test) {
this.currentRunningTest = test;
recorder.retry({
retries: process.env.FAILED_STEP_RETIRES || 3,
retries: process.env.FAILED_STEP_RETRIES || 3,
when: err => {
if (!err || typeof (err.message) !== 'string') {
return false;
Expand Down
2 changes: 1 addition & 1 deletion lib/helper/Puppeteer.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ class Puppeteer extends Helper {
this.sessionPages = {};
this.currentRunningTest = test;
recorder.retry({
retries: process.env.FAILED_STEP_RETIRES || 3,
retries: process.env.FAILED_STEP_RETRIES || 3,
when: err => {
if (!err || typeof (err.message) !== 'string') {
return false;
Expand Down
2 changes: 1 addition & 1 deletion lib/plugin/retryFailedStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ module.exports = (config) => {
event.dispatcher.on(event.test.before, (test) => {
if (test && test.disableRetryFailedStep) return; // disable retry when a test is not active
// this env var is used to set the retries inside _before() block of helpers
process.env.FAILED_STEP_RETIRES = config.retries;
process.env.FAILED_STEP_RETRIES = config.retries;
recorder.retry(config);
});
};
2 changes: 1 addition & 1 deletion test/unit/plugin/retryFailedStep_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('retryFailedStep', () => {
await recorder.catchWithoutStop((err) => err);
}

expect(process.env.FAILED_STEP_RETIRES).to.equal('1');
expect(process.env.FAILED_STEP_RETRIES).to.equal('1');
// expects to retry only once
counter.should.equal(2);
});
Expand Down

0 comments on commit ef39e9b

Please sign in to comment.