title: node.js:Previous test cases break, When I'm tring using http-chai module
body: <p>I'm not using separate databases for production and development. First I tried to test my modules which connect me to mongodb. This works fine. I'm using <strong>chai and mocha</strong> to do this.</p>
  
  <p><strong>Structure of my server files:</strong>
  So when the user hits the route(i.e any url) , route callback calls modules to perform the operation on the db. This is the way server files are organised.</p>
  
  <p>User can hit the route and get/post the data on it.I wrote test cases to test the modules which deal with the mongodb this is great and works.</p>
  
  <p>Now I'm tring to test my routes by the below code but when I'm using it my previous assertion breaks and if I comment out the below code all works great.    </p>
  
  <pre><code>var serverAddress='http://localhost:8080';
  
      var chaiHttp = require('chai-http');
      chai.use(chaiHttp);
  
      describe('login/user', function() {
        it('should login user to the server', function(){
            chai.request(serverAddress)
                .post('/login/user')
                .send({ email: "sandeep@admin.com", password: "admin" })
                .then(function (res) {
                    expect(res).to.have.status(200);
                })
                .catch(function (err) {
                    throw err;
                })
  
        });
      });
  </code></pre>
  
  <p>Error looks like this:</p>
  
  <pre><code>Unhandled rejection AssertionError: expected 'AssertionError' to equal '*****'
  </code></pre>
  
  <p>Any kind of help will be appreciated.</p>