Cypress · Senior · Question 70 of 76

How can you prevent tests from accidentally hitting production?

Show the answer

Correct answer: Guard in config: fail if baseUrl matches production

Explanation

A check in setupNodeEvents that throws on a production URL avoids costly mistakes.

Further reading

Problem with a question

Cypress · Senior · question 70

Test yourself

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

Take this quiz