title: How can I successfully wait for this intercept in Cypress
body: <p>I have a testing route in my application that sets up a user's session. I'm creating the following command, <code>login</code>:</p>
  <pre class="lang-js prettyprint-override"><code>Cypress.Commands.add('login', (attributes = {}) =&gt; {
    cy.intercept('**/_testing/session/new').as('session')
    cy.request('post', '/_testing/session/new', attributes)
    cy.wait('@session')
  })
  </code></pre>
  <p>However, whenever running my tests, <code>cy.wait()</code> times out.</p>
  <p><a href="https://i.stack.imgur.com/HGOYr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HGOYr.png" alt="Failed cy.wait() command" /></a></p>
  <p>I have confirmed in the console that my <a href="https://docs.cypress.io/api/commands/intercept.html#Matching-URL" rel="nofollow noreferrer">minimatch</a> pattern passes.</p>
  <p><a href="https://i.stack.imgur.com/iBoRt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iBoRt.png" alt="Successful minimatch" /></a></p>
  <p>What do I need to do for <code>cy.wait()</code> to detect my <code>intercept</code>?</p>