Cypress · Junior · Question 54 of 75

How do you test a feature that depends on time, like a countdown?

Show the answer

Correct answer: Use cy.clock() and cy.tick()

Explanation

cy.clock() replaces timers and Date, and cy.tick(ms) moves time forward instantly.

Further reading

Problem with a question

Cypress · Junior · question 54

Test yourself

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

Take this quiz