hwillson / meteor-stub-collections

Stub out Meteor collections with in-memory local collections.
MIT License
24 stars 17 forks source link

[Proposal] Add StubCollections.reset to public API #34

Open wanecek opened 4 years ago

wanecek commented 4 years ago

Removes all documents from stubbed collections, which is useful when running multiple tests with different documents.

I've frequently found myself needing to reset the documents in a collection beforeEach test when testing different documents in different scenarios. Currently, the only way to do this is to restore, re-add and re-stub before every test, which seems like an antipattern.

Happy to get feedback, comments, or suggestions :)