Skip to content

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

@shitallakhe

Description

@shitallakhe

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions