forwardemail / forwardemail/supertest
Promises makes jest test time out
- Dominant language
- JavaScript
- Stars
- 14.4k
- Forks
- 782
- PR merge metrics
- No merged PRs in 30d
Description
Hello 👋
Thank you for maintaining this project.
I believe I am experiencing a bug where awaiting a call to get response causes timeout.
Minimal example:
```ts
it("TIMEOUT when awaiting", async () => {
await supertest(app)
.get("/users/me")
});
it("TIMEOUT when using .then", (done) => {
supertest(app)
.get("/users/me")
.then(response => {
done();
});
});
it("WORKING when not using promises at all", () => {
supertest(app)
.get("/users/me");
});
```
The two first tests are failing with the following message:
`Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.Error:`
Please let me know if I have left out any useful information.
All the best! Olav
Contributor guide
Assessment
This issue has not been assessed yet.