{"action":"created","issue":{"url":"https://api.github.com/repos/mfncooper/mockery/issues/16","labels_url":"https://api.github.com/repos/mfncooper/mockery/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/mfncooper/mockery/issues/16/comments","events_url":"https://api.github.com/repos/mfncooper/mockery/issues/16/events","html_url":"https://github.com/mfncooper/mockery/issues/16","id":19855171,"number":16,"title":"Cleaning mocks cache on disable?","user":{"login":"uorbe001","id":610728,"avatar_url":"https://avatars.githubusercontent.com/u/610728?v=3","gravatar_id":"","url":"https://api.github.com/users/uorbe001","html_url":"https://github.com/uorbe001","followers_url":"https://api.github.com/users/uorbe001/followers","following_url":"https://api.github.com/users/uorbe001/following{/other_user}","gists_url":"https://api.github.com/users/uorbe001/gists{/gist_id}","starred_url":"https://api.github.com/users/uorbe001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uorbe001/subscriptions","organizations_url":"https://api.github.com/users/uorbe001/orgs","repos_url":"https://api.github.com/users/uorbe001/repos","events_url":"https://api.github.com/users/uorbe001/events{/privacy}","received_events_url":"https://api.github.com/users/uorbe001/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mfncooper/mockery/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2013-09-21T11:03:39Z","updated_at":"2015-02-02T13:47:28Z","closed_at":"2015-02-02T13:47:28Z","body":"Hi,\r\n\r\nI've been having issues on my tests using mockery when I try to register mocks. When I register the mocks with the ```useCleanCache``` flag to false my mocks are not being used because some other test is using the module I'm trying to mock, this is expected behaviour as far as I know.  The problem is, I'm using ```useCleanCache``` set to true to avoid this, and that makes my mocked test pass properly, but because some later test is trying to use the same mocked module, my tests fail because the later test gets the mock. I'm calling ```mockery.disable``` and ```mocker.deregisterAll``` after the test where I'm using the mock is finished, but apparently the mock is stored on the node module cache so whenever is required again, I get the mock. Is there a way of forcing the cache to be cleaned after mockery is disabled? I thought that was the default behaviour, but it doesn't seem to be working for me?\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/mfncooper/mockery/issues/comments/72460007","html_url":"https://github.com/mfncooper/mockery/issues/16#issuecomment-72460007","issue_url":"https://api.github.com/repos/mfncooper/mockery/issues/16","id":72460007,"user":{"login":"uorbe001","id":610728,"avatar_url":"https://avatars.githubusercontent.com/u/610728?v=3","gravatar_id":"","url":"https://api.github.com/users/uorbe001","html_url":"https://github.com/uorbe001","followers_url":"https://api.github.com/users/uorbe001/followers","following_url":"https://api.github.com/users/uorbe001/following{/other_user}","gists_url":"https://api.github.com/users/uorbe001/gists{/gist_id}","starred_url":"https://api.github.com/users/uorbe001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uorbe001/subscriptions","organizations_url":"https://api.github.com/users/uorbe001/orgs","repos_url":"https://api.github.com/users/uorbe001/repos","events_url":"https://api.github.com/users/uorbe001/events{/privacy}","received_events_url":"https://api.github.com/users/uorbe001/received_events","type":"User","site_admin":false},"created_at":"2015-02-02T13:47:27Z","updated_at":"2015-02-02T13:47:27Z","body":"tbh, the code where I found this issue is long gone and I can't tell what the problem was anymore, I guess it's safe to just close it unless anyone else can replicate it."}}