title: How to intercept all request with cypress to test the response status
body: <p>I looking for a way to intercept all request in cypress.
  I'm thinking about a thing like that:</p>
  <pre class="lang-js prettyprint-override"><code> beforeEach(() =&gt; {
      cy.intercept({method: 'GET', path: '*'}).as('get')
      cy.intercept({method: 'POST', path: '*'}).as('post')
   })
  </code></pre>
  <p>then:</p>
  <pre class="lang-js prettyprint-override"><code> afterEcah(() =&gt; {
      cy.wait('@get').its('response.statusCode').should('be.oneOf', [200, 304])
      cy.wait('@post').its('response.statusCode').should('be.oneOf', [200, 304, 201])
   })
  </code></pre>
  <p>My problem is sometime in my test i don't have a get or a post request, so my test fail.</p>
  <p>Maybe i need a condition is my <code>afterEach()</code> but i can' t figure it out.</p>
  <p>Or perhaps the problem is using <code>afterEach()</code> for this purpose.</p>
  <p>Any help will be welcome</p>