Closed nkahnfr closed 7 years ago
Hey there!
Thanks for reporting in. I see how you mean. I'll try to reproduce it as a failing test case.
@johanbrook Maybe you can see this repro. But run npm run test-d
@johanbrook I created pull request #18 to fix that issue. Hope it helps.
Thanks! Will check it out.
Published as 1.0.6.
Hi,
First thanks for your package, it's really useful for testing Meteor publications.
With latest version I am getting following errors while testing my publications:
Error: done() called multiple times
Here the "done" function is the Mocha callback used for asynchronous code like the one you use in your usage example.
The publications I am testing are using the low-level added/changed/removed interface which means I am also calling the "ready" method once the initial record set is complete. The problem in that case is that you're also calling "this.ready()" at the end of "collect" method and thus the callback passed to the "collect" method is called twice since it's part of the "ready" listener you're defining before calling the publication function.
That behavior was introduced in v1.0.5 since you're now adding the "ready" listener before calling the publication function.
I could be wrong but my recommendation would be to define an empty "ready" method on
PublicationCollector
class (like thestop()
one) and use a different name for your custom ready event.Let me know if that's not clear enough. Thanks for your help.
-Nicolas