Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jest detecting open handle when ran with ts-jest #1909

Closed
vajahath opened this issue Aug 28, 2020 · 2 comments
Closed

Jest detecting open handle when ran with ts-jest #1909

vajahath opened this issue Aug 28, 2020 · 2 comments
Labels
Not An Issue Not ts-jest issue

Comments

@vajahath
Copy link

🐛 Bug Report

Jest detecting open handle when ran with ts-jest. Outside ts-jest, there is no problem. Please note I'm running typescript 4.

test.spec.ts

const got = require("got");

describe("Test", () => {
  test("got test", async () => {
    await got("https://google.com");
  });
});

jest.config.js

module.exports = {
  preset: "ts-jest",
  testEnvironment: "node",
  testMatch: ["**/src/**/*.spec.ts"],
};
➜ npm run test:ts -- test.spec

> jest --detectOpenHandles "test.spec"

 PASS  src/test.spec.ts
  Test
    ✓ got test (1166 ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        3.214 s
Ran all test suites matching /test.spec/i.

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

  ●  DNSCHANNEL

      at new CacheableLookup (node_modules/cacheable-lookup/source/index.js:75:14)
      at Object.<anonymous> (node_modules/got/dist/source/core/index.js:29:24)
      at Object.<anonymous> (node_modules/got/dist/source/as-promise/types.js:16:16)

envinfo

System:
    OS: Ubuntu 20

Npm packages:
    "ts-jest": "^26.3.0",
    "ts-node": "^9.0.0",
    "jest": "^26.4.2",
    "typescript": "^4.0.2"
@vajahath vajahath added Bug Report Needs Repo Need a minimium repository to reproduce the problem Needs Triage labels Aug 28, 2020
@ahnpnl
Copy link
Collaborator

ahnpnl commented Aug 29, 2020

this happens to babel-jest too, not only ts-jest

@ahnpnl
Copy link
Collaborator

ahnpnl commented Aug 29, 2020

See jestjs/jest#6423

@ahnpnl ahnpnl closed this as completed Aug 29, 2020
@ahnpnl ahnpnl added Not An Issue Not ts-jest issue and removed Bug Report Needs Repo Need a minimium repository to reproduce the problem Needs Triage labels Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Not An Issue Not ts-jest issue
Projects
None yet
Development

No branches or pull requests

2 participants