title: passportjs, mocha, supertest ECONNREFUSED
body: <p>I am trying to test authentication with mocha, supertest, and passport but I am getting connection refused error. I assume it has to do with the way I am starting my app... </p>
  
  <pre><code>var testUser = {
      "email": "test@test.com",
      "password": "test"
  };
  
  var app = require('../../server');
  
  var request = require('superagent');
  var user = request.agent(app);
  
  describe('authentication api ', function() {
  
      it('should login a user', function(done) {
          user.post('/login')
              .send(testUser)
              .end(function(err, res) {
                  if(err) throw err;
                  done();
              });
      });
  });
  </code></pre>
  
  <p>This user does exist in my mongo database. Within my server file which is two levels higher:</p>
  
  <pre><code>module.exports = app.listen(port, function() {
      console.log('app listening on port: ' + port);
  });
  </code></pre>