Unable to close mongoose connection after Jest tests #11517
Unanswered
Nikola-Milovic
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone, here's the link to stack overflow with a lot more details but in general I am creating a mongoose connection inside my App code that I am testing, and then after the tests are finished I try closing the connection but the connection is never closed, always leaking. My doubt is that somehow because these are different contexts, one is the
src
and the other is insidetests
that maybe the mongoose object is not the same. But when I print themongoose.connections.length
I always get 1. And also all of my tests are successful... So not sure what is happeningBeta Was this translation helpful? Give feedback.
All reactions