Mocha testing (POST requests): error outside of test suite
<p>I've been thumping my head against a wall for the past day now. Can't figure out what might be throwing the error in Mocha: "Uncaught error outside test suite: Uncaught Error: connect ECONNREFUSED 127.0.0.1:27017" in Mocha.</p>

<p>The test passes, but it throws that error in red.</p>

<p>I am running a simple test for a POST request. There are no other instances of node, mongod or any other app running while testing. I also shut down the express server in an AFTER block to make sure it's done before the next time I try testing.</p>

<p>Code:</p>

<pre><code>describe('UNIT: test the cat express app', () =&gt; {
  after((done) =&gt; {
    server.close();
    done();
  });

  it('should create with a new cat with a POST request', (done) =&gt; {
    chai.request('localhost:3000')
    .post('/app/cats')
    .send({name: 'test cat'})
    .end((err, res) =&gt; {
      expect(err).to.eql(null);
      expect(res).to.have.status(200);
      expect(res.body.name).to.eql('test cat');
      expect(res.body).to.have.property('_id');
      done();
    });
  });
});
</code></pre>

<p>Any advice at all would help. I've looked everywhere but haven't found anything besides just closing the server in an After block.</p>