Cypress · Middle · Question 20 of 77
When should you use Cypress.Commands.overwrite?
- 1Never; it is not supported in current versions
- 2Always, to rename all built-in commands for the team
- 3Rarely, e.g. to add logging or defaults to a built-in command
Show the answer
Correct answer: Rarely, e.g. to add logging or defaults to a built-in command
Explanation
Overwriting changes behaviour everywhere, which surprises readers. Prefer new commands with clear names.