mockery
mockery copied to clipboard
fix: remove cached modules completely from require cache in disable()
Problem:
We noticed memory leak with require cache when using mockery.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.
@mfncooper we've verified this PR fixes the memory leak we were seeing. Any chance of getting this merged?