Expand description
In-process testing without a network socket.
ⓘ
#[tokio::test]
async fn home_page() {
let client = TestClient::new(my_app::routes());
let res = client.get("/").await;
assert_eq!(res.status, 200);
assert!(res.text.contains("Hello"));
}Structs§
- Test
Client - Sends requests to an
Appdirectly. - Test
Response - A collected response.