title: mocking server for SSR react app e2e tests with cypress.io
body: <p>I'm building a single page web application (SPA) with server side rendering (SSR).</p>
  
  <p>We have a node backend API which is called both from the node server during SSR and from the browser after initial rendering.</p>
  
  <p>I want to write e2e tests that configures API responses (like with <code>nock</code>) and work both with browser calls and SSR server calls. some pseudo-code : </p>
  
  <pre><code>it('loads some page (SSR mode)', () =&gt; {
    mockAPI.response('/some-path', {text: "some text"}); // here i configure the mock server response
    browser.load('/some-other-page'); // hit server for SSR response
    expect(myPage).toContain('some text');
  })   
  
  it('loads some other page (SPA mode)', () =&gt; {
    mockAPI.response('/some-path', {text: "some other text"}); // here i configure another response for the same call
    browser.click('#some-link'); // loads another page client side only : no SSR here
    expect(myPage).toContain('some other text');
  })   
  </code></pre>
  
  <p>Currently Cypress allows me to mock fetch on the browser but not on the server.</p>
  
  <p>Is there anything to achieve that ?
  Preferably with node libs.</p>