Я новичок в mocha, сейчас я выполняю вызов API для mocha, но я получаю эту ошибку Uncaught AssertionError: expected { Object (domain, _events, ...) } to have status code 200 but got 401
, кто-нибудь может мне помочь, почему я получаю эту ошибку? вот мой полный код этого
it('Get Organizations', function(done) {
let current_token = currentResponse['token'];
let headers = [{"content-type":"application/json","vrc-access-token": current_token }];
console.log(headers);
chai.request(app)
.post('entities')
.set(headers)
.send({"key":"organizations","operation":"findAll"})
.end(function (err, res) {
currentResponse = res.body;
expect(err).to.be.null;
expect(res).to.have.status(200);
done();
});
});