Hi All,
Was wondering how you do testing around publications…
So my understanding is, need 2 tests for any publication.
- Test to ensure publication is sending out correct information.
- Test to ensure subscription is sending over correct arguments.
How do you do this? Can someone provide some examples for the following scenario’s?
a. Clean publish, but with some role based filter. Like, how do you think about this? Do i create a new collection in the test, and the do the publish, and then check the output? SO If it was a publish of meteor.users, but only those with a role of ‘admin’ or whatever.
b. Publish with some passed variable: (1) Test on the publish, what happens when no variable is send on the subscribe? (2) Test on subscribe sending dodgy information, i.e. something more sophisticated than check.
c. How do you test the output of your find() basically. I keep making mistakes in my find(…args), but it is completely not obvious when i make an error as the collections are pretty similar…
Any resources you could point me in the direction of would also be appreciated. Thanks so much.
Tat