One of the biggest challenges of testing networking code is writing tests that don’t have arbitrary timeouts. Network events are slow and we can’t predict how long they’ll take to arrive. Using timeouts results in tests that are either slow or brittle—or both. Our onNextServerEmit() method helps us solve this problem.

comments powered by Disqus