Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; #131

Open
shitallakhe opened this issue Jun 24, 2020 · 0 comments

Comments

@shitallakhe
Copy link

I am facing above error with the help of supertest and mocha. I had tried with done as well as timeout but still i facing another issue i attched my code please check and let me know ......

it('/LDAP/Registration',async() => {
await request(app)
.post('/api/v1/LDAP/Registration')
.send({
"ldapregistration": {
"serverhostname":"18.00.00.00",
"serverport":"389",
"domain":"abcd.test",
"adminusername":"abcd@abcd.test",
"adminpassword":"user@123",
"issslselected" : "false"
}
}
)
.set('sessionId' , accesstoken)
.set('Accept', 'application/json')
// .expect('Content-Type', /json/)

}).timeout(10000);

2.with the help of done
it('/LDAP/Registration',(done) => {
this.timeouts(300000)
await request(app)
.post('/api/v1/LDAP/Registration')
.send({
"ldapregistration": {
"serverhostname":"18.00.00.0",
"serverport":"389",
"domain":"abcd.test",
"adminusername":"abdc@abcd.test",
"adminpassword":"user@123",
"issslselected" : "false"
}
}
)
.set('sessionId' , accesstoken)
.set('Accept', 'application/json')
// .expect('Content-Type', /json/)

      done();

});

only error is removed by using done() but that function is not calling and code coverage also not increase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant