Error: unable to verify the first certificate

37 views
Skip to first unread message

Sunil Kamble

unread,
Dec 24, 2021, 6:27:03 AM12/24/21
to Chai.js
hi,
 i am new to mocha, chai,
i am trying to execute below scrip getting error Error: unable to verify the first certificate while executing the script,
getting response as undefined


var chai = require('chai');
var chaiHttp = require('chai-http');
chai.use(chaiHttp);
describe('Get Tenant Id', function () {
  it('get /api/tenants/resolve', function (done) {
    chai.request(apiURL)
      .get(`/api/tenants/resolve`)
      .set({ 'X-Client': `Load Testing ` })
      .query({ 'host': `${tenantHost}` })
      .end(function (error, response) {
        console.log('error', error); // ----->unable to verify the first certificate
        console.log('success', response); // -----> undefined
        expect(response).to.have.status(200);
        // expect(response.status).to.be.equal(200);
        done();
      });
  });
});
Reply all
Reply to author
Forward
0 new messages