Skip to content

Running Jest tests with the "--detectOpenHandles" flag shows snappy open handle #289

@mishaled

Description

@mishaled

// sampleTest.spec.ts

describe("sample test", () => {
    it("should be true", () => {
        require("snappy");
    });
});

Output

➜  js-playground yarn jest src/__tests__/sampleTest.spec.ts --detectOpenHandles
yarn run v1.22.22
warning ../../../package.json: No license field
$ /Users/***/Documents/git/js-playground/node_modules/.bin/jest src/__tests__/sampleTest.spec.ts --detectOpenHandles
 PASS  src/__tests__/sampleTest.spec.ts
  sample test
    ✓ should be true (20 ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        0.139 s, estimated 1 s
Ran all test suites matching src/__tests__/sampleTest.spec.ts.

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

  ●  CustomGC

      1 | describe("sample test", () => {
      2 |     it("should be true", () => {
    > 3 |         require("snappy");
        |         ^
      4 |     });
      5 | });
      6 |

      at Runtime._loadModule (node_modules/jest-runtime/build/index.js:940:29)
      at requireNative (node_modules/snappy/index.js:1:4972)
      at Object.<anonymous> (node_modules/snappy/index.js:1:13639)
      at Object.require (src/__tests__/sampleTest.spec.ts:3:9)

✨  Done in 0.77s.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions