Cypress · Senior · Question 70 of 76
How can you prevent tests from accidentally hitting production?
- 1Trust that everyone sets the right URL each time
- 2Run tests only from developers' laptops
- 3Guard in config: fail if
baseUrlmatches 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.