hwillson / meteor-stub-collections

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

Add more stubs for Meteor CollectionHooks cols #21

Closed zeroasterisk closed 6 years ago

zeroasterisk commented 6 years ago

CollectionHooks builds Collections with a hijacked constructor.

They "take over" most collection methods, but StubCollections will stub them... no problem (before this commit).

Though Collectionhooks would make a direct object and allow access to the "pre-hooked" (normal) methods for the Collection.

Until this commit, that meant that all "Stubbed" collections worked as a "stub" for normal methods like MyCol.update(), but would use their "non-stubbed/real" methods when used like MyCol.direct.update()

Now we are "stubbing" both set's of methods.

TODO: It would be really nice if we could make Collectionhooks still run it's functionality on the stubbed collection :/ -- I have not been able to figure out how to accomplish this yet.

re #11 (again)

zeroasterisk commented 6 years ago

Any feedback on this?

hwillson commented 6 years ago

Wow, sorry for the large delay on this @zeroasterisk - I'll definitely get this reviewed shortly. Thanks!

hwillson commented 6 years ago

Thanks for submitting this @zeroasterisk - this all makes sense, and looks good. I'm prepping a new release for tomorrow, and will get this merged in shortly. Thanks again!