question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

open handles with body-parser#1.20.0

See original GitHub issue

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.<anonymous> (test/integration/users/usersMutations.itest.js:45:25)
          at runMicrotasks (<anonymous>)
...

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

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:11
  • Comments:13

github_iconTop GitHub Comments

6reactions
zachsitkacommented, Apr 19, 2022

I am also seeing this.

Jest has detected the following 1 open handle potentially keeping Jest from exiting:

  ●  TCPSERVERWRAP

      24 |       request(app)
    > 25 |           .get('/')
         |            ^
      26 |           .query({/*query data*/})
      27 |           .send()
      28 |           .expect('Location', '/error.html');

      at Test.serverAddress (node_modules/supertest/lib/test.js:48:35)
      at new Test (node_modules/supertest/lib/test.js:34:14)
      at Object.obj.<computed> [as get] (node_modules/supertest/index.js:28:14)
      at Object.<anonymous> (functions/src/express-apps/oauth-callback.spec.ts:25:12)

express = 4.17.3 supertest = 6.2.2

3reactions
dominikwintercommented, Jul 16, 2022

It seems yarn add -D body-parser@^2.0.0-beta.1 fixes the problem …

Read more comments on GitHub >

github_iconTop Results From Across the Web

open handles with body-parser#1.20.0 · Issue #772 - GitHub
Jest has detected the following 64 open handles potentially keeping Jest from exiting: ○ bound-anonymous-fn 23 | 24 | const response ...
Read more >
Developers - open handles with body-parser#1.20.0 - - Bountysource
Jest has detected the following 64 open handles potentially keeping Jest from exiting: ○ bound-anonymous-fn 23 | 24 | const response = await...
Read more >
body-parser - NPM Package Overview - Socket - Socket.dev
Parse incoming request bodies in a middleware before your handlers, available under the req.body property. Note As req.body 's shape is based on...
Read more >
Newest 'body-parser' Questions - Stack Overflow
I've been trying to use console.log's with ther errors and can't figure it out. I have a form to create an account and...
Read more >
body-parser | Node.js body parsing middleware - kandi - Open Weaver
There are 9 open pull requests and 0 closed requests. It has a neutral sentiment in the developer community. The latest version of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found