Cypress · Senior · Question 30 of 76

How do you make date-dependent tests stable across time zones?

Show the answer

Correct answer: Control TZ in CI and freeze time with cy.clock

Explanation

Setting the time zone of the browser process and a fixed clock makes "today" and DST edges deterministic.

Further reading

Problem with a question

Cypress · Senior · question 30

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