It can be tricky to debug REST API tests. You can get a "received 500 when 200 expected", but you don't have the error. There is one manual way to do it: $t->put_ok($url)->status_is(200)->json_is($expected_json)->or( sub { warn $t->tx->res->to_string }); But could we provide a generic way to add a diag in case Test::Mojo fails?
Created attachment 114313 [details] [review] Bug 27190: [DO NOT PUSH] example of failure Apply patches from 18729 to test this change.
Created attachment 114314 [details] [review] Bug 27190: Test::Mojo - Always warn the error string on error
That's pretty ugly, and we will certainly never push it. But at least I will remember next time I need it, hopefully!
(In reply to Jonathan Druart from comment #3) > That's pretty ugly, and we will certainly never push it. But at least I will > remember next time I need it, hopefully! Should we close then?
(In reply to Katrin Fischer from comment #4) > (In reply to Jonathan Druart from comment #3) > > That's pretty ugly, and we will certainly never push it. But at least I will > > remember next time I need it, hopefully! > > Should we close then? I don't think so. It's still useful for debugging purpose and we should have something similar in master.