Skip to content

Commit f9dbefa

Browse files
committed
fix(cypress): fix invalid retries
1 parent 6887164 commit f9dbefa

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

packages/cypress/src/support.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ function beforeEach(options: ArgosScreenshotOptions) {
131131
};
132132
}
133133

134+
function getRetries(value: unknown) {
135+
if (typeof value !== "number") {
136+
return 0;
137+
}
138+
return Math.min(0, value);
139+
}
140+
134141
/**
135142
* Wait for the UI to be ready before taking the screenshot.
136143
*/
@@ -217,7 +224,7 @@ Cypress.Commands.add(
217224
titlePath: Cypress.currentTest.titlePath,
218225
retry: Cypress.currentRetry,
219226
// @ts-expect-error - private property
220-
retries: cy.state("runnable")._retries,
227+
retries: getRetries(cy.state("runnable")._retries),
221228
},
222229
browser: {
223230
name: Cypress.browser.name,

0 commit comments

Comments
 (0)