Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Fixes mfncooper/mockery #51 #57

Merged
merged 1 commit into from
Oct 7, 2016
Merged

Conversation

roblg
Copy link
Contributor

@roblg roblg commented Oct 7, 2016

This fixes #51.

For each mock in the hookedLoader cache, on disable
or reset, remove it from its parent's children list.

This gets rid of the leak in our test suite, which is relatively larges (1100 specs, each one attempting to use a clean mockery cache). I'm by no means an expert on the node module API though, so it's possible that I did something dumb here.

For each mock in the hookedLoader cache, on disable
or reset, remove it from its parent's children list.
@davglass
Copy link
Collaborator

davglass commented Oct 7, 2016

This looks ok to me and all the tests pass :)

I'll make this a major version bump just to be safe..

@davglass davglass merged commit cd60df8 into mfncooper:master Oct 7, 2016
@davglass
Copy link
Collaborator

davglass commented Oct 7, 2016

Published in mockery@2.0.0

carlosvillademor added a commit to carlosvillademor/mockery that referenced this pull request Jun 19, 2017
This is to prevent the disable method to fail if there is anything on
the require cache object that does not have a parent element or
children on that parent object.

This fixes a problem introduced on PR
mfncooper#57
carlosvillademor added a commit to carlosvillademor/mockery that referenced this pull request Jun 19, 2017
This is to prevent the disable method to fail if there is anything on
the require cache object that does not have a parent element or
children on that parent object.

This fixes a problem introduced on PR
mfncooper#57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

useCleanCache: true - leaks memory
2 participants