You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the validate function return false, throws an exception, returns a Promise that resolves to false or rejects, or contains any failing Cypress command, the session will be considered invalid, and setup will be re-run.
However, the return type of the validate function is actually false | void, so it is not possible to return a Promise that resolves to false or rejects
cy.session([user,pwd]=>{/**/},{/* Typescript complains about this as the return type of validate is `false | void` */validate: ()=>Promise.reject('Invalid session)
}
I've assumed this is a documentation issue, but I might be wrong. I'd be up to submitting a PR if needed.
The text was updated successfully, but these errors were encountered:
emilyrohrbough
changed the title
cy.session validate() return type not consistent with documentation
[sessions] cy.session validate() return type not consistent with documentation
May 13, 2022
emilyrohrbough
changed the title
[sessions] cy.session validate() return type not consistent with documentation
[sessions] cy.session validate() TypeScript Types not consistent with documentation
Nov 8, 2022
The code for this is done in cypress-io/cypress#24511, but has yet to be released.
We'll update this issue and reference the changelog when it's released.
I'm submitting a...
Type of bug / changes
The
cy.session
documentation says:However, the return type of the validate function is actually
false | void
, so it is not possible to return a Promise that resolves to false or rejectsI've assumed this is a documentation issue, but I might be wrong. I'd be up to submitting a PR if needed.
The text was updated successfully, but these errors were encountered: