mojolicious/mojo

Support Test2 in Test::Mojo

Open

#1,399 opened on Aug 21, 2019

View on GitHub
 (33 comments) (1 reaction) (0 assignees)Perl (591 forks)auto 404
feature requesthelp wantedneeds feedback

Repository metrics

Stars
 (2,745 stars)
PR merge metrics
 (PR metrics pending)

Description

We should support Test2 out of the box, so we can do stuff like this.

use Test2::V0;
use Test2::Mojo;

my $t = Test2::Mojo->new( ... );

$t->get_ok( '/foo' )
    ->status_is(200)
    ->header_is( 'Content-Type' => match qr{application/json} )
    ->json_is( hash {
        field foo => E;
        field bar => DNE;
        end;
    } );

done_testing;

Contributor guide