chaijs / chai-http

HTTP Response assertions for the Chai Assertion Library.
http://chaijs.com/plugins/chai-http
633 stars 113 forks source link

chai-http always return undefined #269

Open dudvil1 opened 4 years ago

dudvil1 commented 4 years ago

need help please!! i'm try to run this test but the res is always undifined , its weird because when i try it from postman its work fine

the test:

const { chai, assert, should, expect, sinon } = require("../baseTest");

 describe.only("Test the Default routes", function() {
  const server = 'http://localhost:3000';
  this.timeout(20000); 
  it("test the / route", (done) => {
     chai
      .request(server) 
       .get("/") 
       .end(function (err, res) {
         console.log(res);
         expect(err).to.be.null; 
        expect(res).to.have.status(200); 
        done();
      }); 
   }); 
}); 

what im doing wrong