ответ chai-http всегда неопределен - PullRequest
0 голосов
/ 07 апреля 2020

я пытаюсь запустить этот тест, но res всегда неопределен, это странно, потому что, когда я пробую его из почтальона, его работа отлично

мой тест:

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();
      }); 
   }); 
});  

спасибо серия

...