Registry / testing / axum-test-helper

axum-test-helper

JSON →
library0.4.0rscratesunverified

Extra utilities for testing axum applications.

# Cargo.toml [dependencies] axum-test-helper = "0.4.0"
INSTALL
IMPORT
SIG · AXUM-TEST-HELPER
A
axum-test-helper
testingrustv0.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TestClient
use axum_test_helper::TestClient;

Creates a test client for an axum router and sends a GET request.

use axum_test_helper::TestClient; use axum::Router; async fn handler() -> &'static str { "Hello" } #[tokio::main] async fn main() { let app = Router::new().route("/", axum::routing::get(handler)); let client = TestClient::new(app); let resp = client.get("/").await; println!("{}", resp.text().await); }
Debug
Known issues
gotchaRequires tokio runtime for async operations.
fix
Ensure your test is run with #[tokio::test] or similar async runtime.
affects: >=0.4.0
Upgrade
Version history
0.4.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
18
Amazon
1
OpenAI (training)
1
Resources
axum-test-helper — cargo add axum-test-helper · libregistry