Mojolicious hack of the day: Testing WebSockets
In Mojolicious we care a great deal about testing, after all most of Mojolicious itself was developed using test driven development. Recently WebSockets have turned out to be a real challenge in this regard, their extremely dynamic nature makes it pretty much impossible to design a simple Perl test API that would cover all possible use cases. Luckily we’ve been supporting WebSockets for quite some time and know by now that the exact message flow is known in advance for the most common ones, which led to this rather pleasant to use API. ;)
Have fun!