Тестирование Чай Мокко работает локально, но не работает на Дженкинс - PullRequest
0 голосов
/ 20 ноября 2018

Я получаю следующую ошибку

Error: timeout of 10000ms exceeded. Ensure the done() callback is being called in this test.

Буду рад услышать от вас, ребята, и заранее спасибо!

Вот мой код!Ниже мой тестовый пример, который я выполняю на Jenkins

describe('/candidateID route', () => {
  it('gets the candidate info', function (done) {
    chai.request(server)
      .get('/candidateInfo/' + candidateId + '/' + reqNum)
      .set('jwt', vcapServices.JWT_TOKEN)
      .end(function (err, res) {
        if(err) {
          done(err);
          return;
        }
        expect(res).to.have.status(200);
        res.body.should.be.a('array');
        res.body.length.should.be.eql(1);
        expect(res.body[0]).to.have.a.property('applicantId');
        expect(res.body[0]).to.have.a.property('requistionNumber');
        expect(res.body[0]).to.have.a.property('firstName');
        expect(res.body[0]).to.have.a.property('lastName');
        expect(res.body[0]).to.have.a.property('emailAddress');
        expect(res.body[0]).to.have.a.property('storeNumber');
        expect(res.body[0]).to.have.a.property('locationCountry');
        expect(res.body[0]).to.have.a.property('locationStateCode');
        expect(res.body[0]).to.have.a.property('firstAddress');
        expect(res.body[0]).to.have.a.property('secondAddress');
        expect(res.body[0]).to.have.a.property('thirdAddress');
        expect(res.body[0]).to.have.a.property('cityName');
        expect(res.body[0]).to.have.a.property('state');
        expect(res.body[0]).to.have.a.property('zipCode');
        done();
      });
  });
});

1 Ответ

0 голосов
/ 21 ноября 2018

Я столкнулся с подобной проблемой с CircleCI.Я обновил файл mocha.opts с параметром timeout, чтобы решить проблему.Не самое элегантное решение, но работает.

--timeout 99999999 
...