Skip to content

chai-http always return undefined #269

Open
@dudvil1

Description

@dudvil1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions