-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
--detectLeaks reporting leaks on a very minimal test environment #5234
Comments
Note that this fails for both jsdom and node environments and for all Jest 22 releases Fix is in the above PR |
This is happening to me in jest v25 |
Also with me in Jest v25. Mine was even smaller: describe('MemoryLeakTest', function () {
it('should do nothing', function () {
expect(true).toBeTruthy()
})
})
|
I submitted a new issue for this problem in v25: #9507 |
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. |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
Jest
--detectLeaks
is reporting leaks even on very minimal test suites.I've set up an example repo here: https://github.com/kand/jest-22-mem-leak
There are two test files:
As well as some added
console.log
statements innode_modules/jest-leak-detector/build/index.js
:Which produces the following output when tests are run:
It doesn't appear that either of these tests should be producing a memory leak. Memory leaks are also reported when
--runInBand
is not used. It looks like the leak detector is checking for memory leaks before theJSDOMEnvironment
object is cleaned up, which causes jest to report a memory leak, though I'm sure this is not the root cause.I believe these issues are related:
#1893
jsdom/jsdom#1682
jsdom/jsdom#1682
But 2 are closed and the open one hasn't had activity in a while.
What is the expected behavior?
No memory leaks are reported.
Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
jest@22.04
yarn@1.0.2
npm@5.5.1
node@8.9.0
macOS Sierra (version 10.12.6)
The text was updated successfully, but these errors were encountered: