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 leaking memory even after calling nock.restore() #2383

Closed
1 of 2 tasks
RedTn opened this issue Jul 19, 2022 · 4 comments · May be fixed by #2407
Closed
1 of 2 tasks

Jest leaking memory even after calling nock.restore() #2383

RedTn opened this issue Jul 19, 2022 · 4 comments · May be fixed by #2407
Labels

Comments

@RedTn
Copy link

RedTn commented Jul 19, 2022

Please avoid duplicates

Reproducible test case

https://github.com/RedTn/nock-memory-leak

Nock Version

13.2.8

Node Version

16.10.0

TypeScript Version

No response

What happened?

Was asked to create a new issue: #2077 (comment)

The README says to call nock.restore() to prevent a memory leak in jest.
https://github.com/nock/nock#memory-issues-with-jest

However, in my sample repo this is not the case.

This is similar but not the same as #2358, simply importing nock is enough to cause a memory leak

Would you be interested in contributing a fix?

  • yes
@kevcodez
Copy link

@RedTn Did you find any workaround in the meantime?

@ForestBeaver
Copy link

ForestBeaver commented Oct 27, 2022

We encountered this when upgrading a project to Node 16. A draft PR that fixes it for me: #2407

@pexxi
Copy link

pexxi commented Nov 8, 2022

Any news about this one?

@mikicho
Copy link
Contributor

mikicho commented Feb 6, 2024

I think #2572 fixed this.
Closing this, feel free to reopen if needed.

@mikicho mikicho closed this as completed Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants