Current behavior
A simple custom command that relies on prevSubject is not correctly typed.
Desired behavior
The "previous subject" argument should be correctly added to the command type and error if not passed.
Test code to reproduce
declare global {
namespace Cypress {
interface Chainable {
confirmClick(): void;
}
}
}
Cypress.Commands.add('confirmClick', { prevSubject: true }, (confirmButton) => {
confirmButton.click();
cy.wrap(confirmButton)
.should('have.attr', 'data-state', 'confirming')
.click({ force: true });
});
Cypress Version
9.0.0
Other
No response
Current behavior
A simple custom command that relies on prevSubject is not correctly typed.
Desired behavior
The "previous subject" argument should be correctly added to the command type and error if not passed.
Test code to reproduce
Cypress Version
9.0.0
Other
No response