Cypress · Junior · Question 55 of 75

What does cy.stub() create?

Show the answer

Correct answer: A fake function you can control and inspect

Explanation

Stubs replace methods, for example window.open, and record calls for assertions.

Further reading

Problem with a question

Cypress · Junior · question 55

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