dareid / chakram

REST API test framework. BDD and exploits promises
http://dareid.github.io/chakram/
MIT License
908 stars 99 forks source link

How to properly increase test timeout #117

Closed starrett67 closed 6 years ago

starrett67 commented 6 years ago

I am currently using chakram to test an api that takes some time. I am finding that even though I can verify I get a response in under the time the timeout is thrown, mocha is still timing out before exiting the test.

Here is my test:

it('POST valid username should return a valid user object', function(done) {
        this.timeout(10000);
        return chakram.post(register_uri, new_user)
            .then(response => {
                expect(response).to.have.status(200);
                expect(response).to.comprise.of.json(new_user);
                done();
            });
})

Is this the correct way to extend the timeout? Anything I am doing wrong?

starrett67 commented 6 years ago

Found that the issue is passing done into the function. Don't do that.