title: Node.js Nock simulate request timeout and subsequent success
body: <p>I'm trying to simulate service request timeouts to test the node requestretry module, which allows you to specify a request max # of attempted retries and retry delay. In order to test this, I need to use nock to simulate a timeout for the first X number of requests, then respond successfully to the same request. I know there is the 'socketDelay()' method to delay the connection, but how do I specify a successful response after that first delayed response?</p>
  
  <p>I have this, which simulates a timeout on the first request</p>
  
  <pre><code>//delays the first request's response by 1500
  nock(urlHost)
       .post('/' + uriPath)
       .socketDelay(1500)
       .reply(200, 'response body');
  </code></pre>
  
  <p>but how can I make it respond faster after that to simulate the service recovering? I'm looking to do something along these lines</p>
  
  <pre><code>//delays the first two request's responses by 1500
  nock(urlHost)
      .post('/' + requestIdentifier.ttoRoutingInfo.uriPath)
      .socketDelay(1500)
      .reply(200, 'response body')
      .times(2)
    //delays the third request by only 300
      .then
      .socketDelay(300)
      .reply(200, 'response body');
  </code></pre>