-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: retries validation #8268
fix: retries validation #8268
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
retries: π
…Sent from my iPhone
On Aug 12, 2020, at 21:12, Chris Breiding ***@***.***> wrote:
@chrisbreiding commented on this pull request.
In packages/server/lib/util/validation.js:
> @@ -104,18 +104,19 @@ const isValidBrowserList = (key, browsers) => {
}
const isValidRetriesConfig = (key, value) => {
- const isNullOrNumber = isOneOf([_.isNumber, _.isNull])
-
- if (
- isNullOrNumber(value)
- || (_.isEqual(_.keys(value), ['runMode', 'openMode']))
- && isNullOrNumber(value.runMode)
- && isNullOrNumber(value.openMode)
- ) {
+ const optionalKeys = ['runMode', 'openMode']
+ const isValidRetryValue = (val) => _.isNull(val) || (_.isNumber(val) && val >= 0)
Should we go ahead and validate that it's an integer? Make sure some joker doesn't try retries: 2.3?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
End up in a retry loop. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
isNumberOrNull
returning an error message string and being checked for falsiness.runMode
andopenMode
were required when using the object signature. This fixes that.How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?