The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

TESTING

Testing a Minima web application is a straightforward task thanks to Plack::Test and HTTP::Request::Common. A basic setup looks like this:

my $app = \&Minima::Setup::init;
my $test = Plack::Test->create($app);

If you'd prefer to simplify it further, Minima::Setup provides a test method:

my $test = Minima::Setup::test;
my $res = $test->request(GET '/');
is( $res->code, 200, 'returned 200 for root' );
like( $res->content, qr/<html>/, 'outputs HTML' );

SEE ALSO

Minima, Minima::Project, Minima::App.

AUTHOR

Cesar Tessarin, <cesar@tessarin.com.br>.

Written in September 2024.