hwillson / meteor-stub-collections

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

Strategy for stubbing linked/hidden collections (more globally) #3

Open zeroasterisk opened 8 years ago

zeroasterisk commented 8 years ago

I know this breaks the idea of unit tests being isolated and mocking all interdependence... but I have had a hard time getting spys/mocks working in Meteor (which is really the core issue to solve)...

In the meantime, this is a great tool for stubbing "the currently scoped" collection to be in-memory only... But I have some methods, which call collection functions, which are not in scope during my testing... is there some way to also stub those other collections somehow? I don't really see how, since ES6 import is encapsulating the collection object for each file.... right?

Recommendations?