How to get verbose output when testing API?

When client get 500 error, I just get this

  1. get an item
  expected 500 to equal 200
  500 => 200

How to get message on why it return 500?

Simply console.log(response.error) before the assertion statement

What if I propose to make it default behavior?
So we don’t have to console logging around and clean it up after we done.

1 Like

How does Adonis knows that it should print the error?
I mean on what basis?

I think it could be placed inside client method. I don’t really know where, even after digging into vow source code.
But I do know you use superagent as base client, so maybe if superagent return error, then console.log it.

1 Like

Really annoying to write console.log(res.error) when i see 500 in test just to understand what is wrong in test. I sont know solution, though. Maybe some hook in for client? Like

client.onError((res) => {if (res.status===500) console.log(res.error)})