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

[Bug]: --detectLeaks reports a false positive for failing tests #15222

Closed
sbmelvin opened this issue Jul 30, 2024 · 4 comments
Closed

[Bug]: --detectLeaks reports a false positive for failing tests #15222

sbmelvin opened this issue Jul 30, 2024 · 4 comments

Comments

@sbmelvin
Copy link

Version

29.7.0

Steps to reproduce

If using --detectLeaks, this code will produce a false positive:

test('Drip drip drip', () => {
  expect(1).toBe(2); // test fails
});

This code will not:

test('Drip drip drip', () => {
  expect(1).toBe(1); // test passes
});

Expected behavior

A test's pass/fail status should not affect --detectLeaks.

Actual behavior

When a test fails, --detectLeaks will report a memory leak regardless if one exists.

Additional context

No response

Environment

System:
    OS: macOS 14.5
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 21.1.0 - ~/.nvm/versions/node/v21.1.0/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.2.0 - ~/.nvm/versions/node/v21.1.0/bin/npm
  npmPackages:
    jest: ^29.7.0 => 29.7.0
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Aug 29, 2024
Copy link

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 28, 2024
Copy link

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant