Превышен тайм-аут 3000 мс - PullRequest
0 голосов
/ 04 мая 2020

я хотел добавить задержку между двумя тестами, потому что один зависит от другого

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

Error: Timeout of 3000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

тестовый код

it('save Prods', function(done){

        this.timeout(3000); 

        setTimeout(() => {
           graphql.saveProd.resolve(null,
                {
                    prod_id : prod_id,
                })
                .then(data => {

                        expect(data).to.be.an('array')
                        done()

                }).catch(done) <----- as you see here i added done() in both cases (then & catch)

            },3000)
    })

...