1

I've got strange error with Jenkins. When I run localy tests everything is ok. But If I run tests on Jenkins I always get error: Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

My before step:

before(function () {
return chakram.get(`{baseUrl}/api/cats`)
    .then(apiResp => {
        return getCats= apiResp;
        })
})
pierozek
  • 27
  • 2
  • Maybe your request needs more time to be processed on jenkins than on your own machine. You can increase mochas timeout with the timout functionality. see [this answer](https://stackoverflow.com/questions/23492043/change-default-timeout-for-mocha/23492442#23492442) – Rhayene Sep 05 '17 at 11:14
  • Possible duplicate of [In mocha testing while calling asynchronous function how to avoid the timeout Error: timeout of 2000ms exceeded](https://stackoverflow.com/questions/16607039/in-mocha-testing-while-calling-asynchronous-function-how-to-avoid-the-timeout-er) – Rhayene Sep 05 '17 at 11:21
  • The error message describes the problem with your code. You never call `done()` – codtex Sep 05 '17 at 11:28
  • 1
    @codtex calling `done()` is not necessary when returning a promise – Rhayene Sep 05 '17 at 13:50

0 Answers0