I am trying to clean database after each feature however every approach which I tried failed. I tried to remove whole mongo collection, dropDatabase almost everything (I guess)
Including
mongoose.connection.dropDatabase(() => {})
User.remove({ 'local.email': '[email protected]' })
It seems like nothing is happening to the records in database. By the way my database is hosted on mlab.com (its not local database). I am establishing moongose.connection during starting application (node server.js) so there is no need for connecting to db from the hook, I think.
I want to implement this code in provided hook below.