sindresorhus / got

🌐 Human-friendly and powerful HTTP request library for Node.js
MIT License
14.27k stars 935 forks source link

Jest has detected open handle JSSTREAM http2-wrapper #2288

Open garrettg123 opened 1 year ago

garrettg123 commented 1 year ago

Describe the bug

Running Jest after switching to ESM shows the error below. "got" is the only package I have that uses http2-wrapper, so it seems like the prime suspect. I will do more research on how to properly mock it or close it as I'm sure there is an easy fix but I couldn't find it in the existing issues.

Actual behavior

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

  ●  JSSTREAM

      at Object.<anonymous> (../node_modules/http2-wrapper/source/utils/js-stream-socket.js:6:25)
      at Object.<anonymous> (../node_modules/http2-wrapper/source/proxies/h1-over-h2.js:5:24)
      at Object.<anonymous> (../node_modules/http2-wrapper/source/index.js:13:5)

Expected behavior

No open handles

Code to reproduce

yarn node --loader ts-node/esm/transpile-only --experimental-vm-modules $(yarn bin jest) --config jest.config.js --verbose --detectOpenHandles

Checklist

kevinlul commented 1 year ago

Is this a duplicate of #1516?