forwardemail / forwardemail/supertest

open handles with body-parser#1.20.0

Open
#772 16 comments 16 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
14.4k
Forks
782
PR merge metrics
No merged PRs in 30d

Description

Hallo,

jest test run does not exit and instead prints this error

```
Jest has detected the following 64 open handles potentially keeping Jest from exiting:
● bound-anonymous-fn
23 |
24 | const response = await request
> 25 | .post('/gql')
| ^
26 | .set('origin', config.devHosts[0])
27 | .send(loginQuery)
28 | .expect(200);
at Test.serverAddress (node_modules/supertest/lib/test.js:48:35)
at new Test (node_modules/supertest/lib/test.js:34:14)
at Object.post (node_modules/supertest/index.js:28:14)
at login (test/integration/helpers/login.js:25:6)
at Object. (test/integration/users/usersMutations.itest.js:45:25)
at runMicrotasks ()
...
```

We have found this happens only for the routes where we use the express `body-parser` middleware.
express version = 4.17.3
body-parser version = 1.20.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.