Skip to content

Commit

Permalink
Print failed response body in integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: Lann Martin <[email protected]>
  • Loading branch information
lann committed Sep 13, 2022
1 parent 29fed29 commit 50b2b39
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,11 @@ mod integration_tests {
expected: u16,
) -> Result<()> {
let res = req(s, absolute_uri).await?;
assert_eq!(res.status(), expected);
let status = res.status();
let body = hyper::body::to_bytes(res.into_body())
.await
.expect("read body");
assert_eq!(status, expected, "{}", String::from_utf8_lossy(&body));

Ok(())
}
Expand Down

0 comments on commit 50b2b39

Please sign in to comment.