A Mojolicous::Lite
app is a fully fledged Mojolicious application, just with more convenient syntax.
Unfortunately, the Routes object does not document an API for enumerating all routes. You will therefore have to traverse the route tree yourself. The corresponding source code for the Mojolicious::Command::routes
command is rather convoluted. Alternatively, you can ->find($name)
specific routes by name.
The app is accessible from a Test::Mojo
object as $test->app
. Note that the docs for that method include a test that verifies routing:
ok $t->app->routes->find('echo')->is_websocket, 'WebSocket route';
Note that you must initialize the test object with the app name, or assign it an app instance later in order to access the app through the test object.