hwillson / meteor-stub-collections

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

Compatibility to matb33:collection-hooks #11

Closed umbertooo closed 7 years ago

umbertooo commented 7 years ago

Hi, I try to use this package in project that makes heavy use of matb33:meteor-collection-hooks. I couldn't get the stubs-collections to work. Even when I copied your test code into the project (which, I suppose, sets up the StubCollections correctly ;) ) didn't work but reports:

AssertionError: expected 1 to equal 0 at Assertion.assertEqual (packages/practicalmeteor_chai.js?hash=5d06a5b89c39aede3a7f54e2ebfee2e82be547ff:1423:12) at Assertion.ctx.(anonymous function) as equal at Context. (packages/local-test_hwillson_stub-collections.js?hash=6d76189a9c590d6ed651e0c5dfcd9486279f5c8c:75:39) at callFn (packages/practicalmeteor_mocha-core.js?hash=12c98471b374d75331cd9dcc7e691e23967c4550:4345:21) at Test.Runnable.run (packages/practicalmeteor_mocha-core.js?hash=12c98471b374d75331cd9dcc7e691e23967c4550:4338:7) at Runner.runTest (packages/practicalmeteor_mocha-core.js?hash=12c98471b374d75331cd9dcc7e691e23967c4550:4808:10) at packages/practicalmeteor_mocha-core.js?hash=12c98471b374d75331cd9dcc7e691e23967c4550:4919:12 at next (packages/practicalmeteor_mocha-core.js?hash=12c98471b374d75331cd9dcc7e691e23967c4550:4728:14) at packages/practicalmeteor_mocha-core.js?hash=12c98471b374d75331cd9dcc7e691e23967c4550:4738:7 at next (packages/practicalmeteor_mocha-core.js?hash=12c98471b374d75331cd9dcc7e691e23967c4550:4670:14)

I tried deactivating the installed packages and found out that these collection hooks are the problem. It looks like the collection hooks create some wrappers, StubCollections doesn't recognize... I forked your repo and added them to the test environment: https://github.com/umbertooo/meteor-stub-collections/commit/33843c5a74ad3101138b5eee029c699db958a70a

hwillson commented 7 years ago

Thanks for reporting this @umbertooo - @Davidyuk has submitted a PR to fix this, which I've merged and will get published soon.

hwillson commented 7 years ago

1.0.3 has been published - thanks again!