Mojo Wonk Blog.

A semi-offical blog dedicated to the Mojolicious web framework

Day 20: Testing Dancer

Dancers and judges at a dance competition

Authors of Dancer (and other) PSGI applications are probably accustomed to testing with Plack::Test, and while that is a venerated option, it is pretty bare-bones.

During advent last year, I wrote about Test::Mojo, showing the many easy and (dare I say) fun ways that you can use it to test your Mojolicious applications. If you missed it, go check it out.

I expect there are at least a few of you out there who read that and think, "I'd love to use that, but I don't use Mojolicious!"; well, you're in luck! With just a little role to bridge the gap, you can use Test::Mojo to test your PSGI applications too!

Continue reading Day 20: Testing Dancer...

Day 9: The Best Way to Test

Woman using chemistry lab equipment

Ok so it is a bit of a click-bait headline. But that doesn't mean I don't believe it.

Test::Mojo is a test framework for websites and related technologies. While its true that there are many such tools, this one gets its power comes from combining so many of the tools that Mojolicious provides. A full non-blocking web server, including websockets, an event loop, an XML/HTML DOM parser, JSON parser and emitter, and more all come together to make incredibly detailed testing simple. Further, with the recent additions in support of roles (which will be discussed in a future post), Test::Mojo is becoming an extensible testing platform.

In this article, I'll give a quick overview of how to use Test::Mojo and some of its methods. Rest assured you'll see more of it as the series continues.

Continue reading Day 9: The Best Way to Test...