Cypress · Middle · Question 8 of 77

How do you simulate a slow API in Cypress?

Show the answer

Correct answer: cy.intercept('/api/*', (req) => req.reply({ delay: 3000 }))

Explanation

Delays let you test loading states and timeouts. throttleKbps simulates slow bandwidth.

Further reading

Problem with a question

Cypress · Middle · question 8

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