This questions is specifically in relation to stubbing in Cypress with cy.intercept()
, and writing E2E tests. I'm trying to figure out where exactly these intercept stubs get cleared.
In the Cypress documentation they use terms like "Suite" and "Test" but these aren't explicitly defined anywhere in their docs that I can find, and the more I read the more confused I'm getting.
For the Intercepts, in particular, the documentation says:
All intercepts are automatically cleared before every test. (reference)
So let's extend a small example from their documentation and say I have this:
describe('My First Test', () => {
it('Does not do much!', () => {
expect(true).to.equal(true)
})
it('Does do this though!', () => {
expect(true).to.equal(true)
})
it('Is pretty great!', () => {
expect(true).to.equal(true)
})
})
From what I can tell actually running Cypress, the intercepts are cleared after each it(...)
block - so each of those blocks is considered to be a "Test"?
Then every describe(...)
would be considered a "Suite" here?