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
When assigning the return value of a Cypress command to a variable via a ternary operator, the plugin does not throw an error:
Cypress.Commands.add('getFormByName',{prevSubject: 'optional'},(subject)=>{constformGroupSelector='form-group';// This throws an error, as expectedletformGroup1=cy.get(formGroupSelector);// This does not throw an error, although I would expect it to do soconstformGroup=subject
? cy.wrap(subject).find(formGroupSelector)
: cy.get(formGroupSelector);formGroup.find('other-selector');// do more stuff});
Is this the expected behavior? If not, it would be great if the compiler could also throw an error when assigning a value via the ternary operator.
When assigning the return value of a Cypress command to a variable via a ternary operator, the plugin does not throw an error:
Is this the expected behavior? If not, it would be great if the compiler could also throw an error when assigning a value via the ternary operator.
You can also try it out on this stackblitz: https://stackblitz.com/edit/eslint-cypress-4eyvq9i?file=cypress.js
The text was updated successfully, but these errors were encountered: