title: How to add params with GET request using nock.js
body: <p>I am trying to test if my API routes are working using nock.js to mock url requests. </p>
  
  <p>My routing file routes according to the following logic:</p>
  
  <pre><code>app.get('/api/study/load/:id', abc.loadStudy );
  </code></pre>
  
  <p>'loadStudy' method in 'abc.js' is used to handle the below particular GET request. Hence, any GET request from a browser has a 'params' key with 'id' parameter that replaces ':id' in the URL. However, when I try to mock this GET request using nock.js I'm not able to pass this 'id' parameter in the request.</p>
  
  <pre><code>var abc = require('G:\\project\\abc.js');
  var nock = require('nock');
  
  var api = nock("http://localhost:3002")
            .get("/api/test/load/1")
            .reply(200, abc.loadStudy);
  
  request({ url : 'http://localhost:3002/api/study/load/1', method: 'GET', params: {id : 1}}, function(error, response, body) { console.log(body);} ); 
  </code></pre>
  
  <p>My method makes use of 'params' key that is sent with request which I'm not able to mock. Printing <em>'req'</em> in the below code just gives <em>'/api/test/load/1'</em> . How can I add <em>'params'</em> to the GET request?</p>
  
  <pre><code>loadStudy = function(req, res) {
      console.log(req);
      var id = req.params.id;
  };
  </code></pre>