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.
Functions§
- layout_
keys - Keys of the layouts marked in a page, outermost first.
- strip_
layout_ markers - A page’s HTML without the layout markers used by partial navigation, for comparing markup in tests.