Skip to content

[v25] --detectLeaks option always reports a leak when using jsdom environment #9507

@dylanwulf

Description

@dylanwulf

💥 Regression Report

Starting in v25, the --detectLeaks option will always report a leak when using env=jsdom.

Last working version

Worked up to version: v24.9.0

Stopped working in version: v25.0.0

To Reproduce

https://github.com/dylanwulf/jest-25-detect-leak
npm run test: run test with jsdom environment
npm run test:sixteen: run test with jest-environment-jsdom-sixteen
npm run test:node: run test with node environment

When using jsdom or jest-environment-jsdom-sixteen it reports a memory leak even though the only thing in the test is a console log. When using the node environment, it does not report a leak.

Expected behavior

Should not report a memory leak for a simple test that clearly does not leak memory.

Link to repl or repo (highly encouraged)

https://github.com/dylanwulf/jest-25-detect-leak

Run npx envinfo --preset jest

Paste the results here:

  System:
    OS: Windows 10 10.0.18363
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
  Binaries:
    Node: 12.14.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.21.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    jest: 25.1.0 => 25.1.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions