Cypress · Middle · Question 58 of 77

How do you test a request that should NOT happen?

Show the answer

Correct answer: Intercept it with an alias and assert the call count is 0

Explanation

cy.get('@track.all').should('have.length', 0) checks no tracking call fired, for example when consent was declined.

Further reading

Problem with a question

Cypress · Middle · question 58

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