So here's the rub - I have a system that, when an event occurs, fires off a chain of disparate asynchronous code (some code even fires off more events).
Now during acceptance testing I fire that same event - but what strategy should use to notify the test runner that all the subsequent events are finished and ready to move on to the next step?
I started out just waiting for fixed amount of time - but I that was always just a fudge. And now, I'm hooking in to the tail events and moving on when they have all finished. But I can see this becoming v. complex as the system grows.
Just wondering if there is an alternative strategy that I've missed. Any suggestions?
FWIW I'm using cucumber.js & zombie to test an express app on node.js.
Cheers and thanks for your time,
Gordon