Cypress · Middle · Question 58 of 77
How do you test a request that should NOT happen?
- 1Requests that don't happen can't be tested
- 2Wait 10 seconds and check the page is unchanged
- 3Intercept it with an alias and assert the call count is 0
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.