{"action":"created","issue":{"url":"https://api.github.com/repos/mccormicka/Mockgoose/issues/179","repository_url":"https://api.github.com/repos/mccormicka/Mockgoose","labels_url":"https://api.github.com/repos/mccormicka/Mockgoose/issues/179/labels{/name}","comments_url":"https://api.github.com/repos/mccormicka/Mockgoose/issues/179/comments","events_url":"https://api.github.com/repos/mccormicka/Mockgoose/issues/179/events","html_url":"https://github.com/mccormicka/Mockgoose/issues/179","id":130209848,"number":179,"title":"beforeEach and mockgoose.reset issue","user":{"login":"root-io","id":6101308,"avatar_url":"https://avatars.githubusercontent.com/u/6101308?v=3","gravatar_id":"","url":"https://api.github.com/users/root-io","html_url":"https://github.com/root-io","followers_url":"https://api.github.com/users/root-io/followers","following_url":"https://api.github.com/users/root-io/following{/other_user}","gists_url":"https://api.github.com/users/root-io/gists{/gist_id}","starred_url":"https://api.github.com/users/root-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/root-io/subscriptions","organizations_url":"https://api.github.com/users/root-io/orgs","repos_url":"https://api.github.com/users/root-io/repos","events_url":"https://api.github.com/users/root-io/events{/privacy}","received_events_url":"https://api.github.com/users/root-io/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mccormicka/Mockgoose/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-01-31T23:10:36Z","updated_at":"2016-02-18T15:41:49Z","closed_at":null,"body":"```\r\nbeforeEach(function(done) {\r\n  mockgoose.reset(function() {\r\n    done();\r\n  });\r\n});\r\n```\r\nMy collections don't seem to be removed\r\n\r\nnodejs 4.2.6\r\nmongodb 3.2.1\r\nmongoose 4.3.7\r\nmockgoose 5.2.4"},"comment":{"url":"https://api.github.com/repos/mccormicka/Mockgoose/issues/comments/185782215","html_url":"https://github.com/mccormicka/Mockgoose/issues/179#issuecomment-185782215","issue_url":"https://api.github.com/repos/mccormicka/Mockgoose/issues/179","id":185782215,"user":{"login":"SkateFreak","id":2161649,"avatar_url":"https://avatars.githubusercontent.com/u/2161649?v=3","gravatar_id":"","url":"https://api.github.com/users/SkateFreak","html_url":"https://github.com/SkateFreak","followers_url":"https://api.github.com/users/SkateFreak/followers","following_url":"https://api.github.com/users/SkateFreak/following{/other_user}","gists_url":"https://api.github.com/users/SkateFreak/gists{/gist_id}","starred_url":"https://api.github.com/users/SkateFreak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkateFreak/subscriptions","organizations_url":"https://api.github.com/users/SkateFreak/orgs","repos_url":"https://api.github.com/users/SkateFreak/repos","events_url":"https://api.github.com/users/SkateFreak/events{/privacy}","received_events_url":"https://api.github.com/users/SkateFreak/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T15:41:49Z","updated_at":"2016-02-18T15:41:49Z","body":"@rsignavong i had the same problem. i discovered that the order of the commands matters.\r\n\r\nhere is my setup:\r\n\r\n    import mockgoose from 'mockgoose'\r\n    import mongoose from 'mongoose'\r\n    \r\n    mockgoose(mongoose);\r\n    \r\n    var app = require('../server/server');\r\n    var request = require('supertest');\r\n    var req = request(app);\r\n    \r\n    after(function (done) {\r\n        mockgoose.reset();\r\n        mongoose.unmock(function () {\r\n            done();\r\n        });\r\n    });\r\n    \r\n    describe('...', function () {\r\n        it('...', function (done) {\r\n            request(app)\r\n                .get('...')\r\n                .end(function (err, res) {\r\n                    if (err) return done(err);\r\n    \r\n                    ...expect...\r\n    \r\n                    done();\r\n                });\r\n        });\r\n    });"}}