Cypress · Middle · Question 20 of 77

When should you use Cypress.Commands.overwrite?

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.

Further reading

Problem with a question

Cypress · Middle · question 20

Test yourself

Take the Cypress · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz