Open wenboyu2 opened 5 years ago
Problem: We noticed memory leak with require cache when using mockery.enable({useCleanCache: true}). disalbe() doesn't clean up the cache completely.
require
mockery.enable({useCleanCache: true})
disalbe()
Solution: Remove module references from m._cache as well as the module's parents' children.
m._cache
@mfncooper we've verified this PR fixes the memory leak we were seeing. Any chance of getting this merged?
Problem: We noticed memory leak with
require
cache when usingmockery.enable({useCleanCache: true})
.disalbe()
doesn't clean up the cache completely.Solution: Remove module references from
m._cache
as well as the module's parents' children.