New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Reset database #31
Comments
Hm I'm not sure if that's a good idea or not, yet. Keeping track of all the created models is certainly easy, but you could build models with monky and save them later on in your tests without monky knowing about it. Furthermore it would increase monky's footprint quite a lot for a very "small" feature. In general from my experience you'd want to clean the whole (test) database anyways for each run of a test don't you? What I could potentially see is either a monky feature like On the other hand, clearing the database should be as simple as doing What do you think, did you have something else in mind? |
It make sense to only clean specific collections, not entire db, for example, I will clean 'User' collection after register test suit. |
My inspiration for this idea was this project https://github.com/DatabaseCleaner/database_cleaner It's almost unanimously used in rails testing stacks. It's pretty frustrating to have to clean out the db before every test that uses it. Once you get a larger test suite, lots of it would begin with cleaning out the test suite rather than have something you could hook into automatically to do it. |
Yeah I know I'd suggest to write a separate module just like |
It would be awesome if monky kept track of what it created and we could call a method to reset the database.
The text was updated successfully, but these errors were encountered: