axum-impl-testing
OfficialTest Axum apps reliably with real wiring
System Documentation
What problem does it solve?
This Skill prevents flaky or misleading Axum tests by ensuring every test drives the same fully configured app wiring, with correct handling of JSON request content types and response body collection. It also avoids common integration-test breakages where tests/ can’t access a private app() constructor, and it fixes compile-time failures caused by reusing a consumed oneshot service across multiple requests.
Core Features & Use Cases
- Shared app() constructor discipline: Route unit and integration tests through one shared
app()(orpub fn app(...)) so tests prove the real shipped wiring. - Two deterministic testing approaches: Use
tower::ServiceExt::oneshotfor fast handler/unit tests oraxum-test::TestServerfor ergonomic integration tests with fluent assertions. - Correct JSON and body reading: Set
Content-Type: application/jsonfor raw JSONoneshotrequests to avoidMissingJsonContentType/415, and always read response bodies viainto_body()+http_body_util::BodyExt::collect()before inspecting bytes. - Multi-request sequencing: Use
.into_service()plusready()/call()when you need multiple requests against one app instance. - Integration test visibility: Export
app()fromsrc/lib.rssotests/crates can import it successfully.
Quick Start
Use the axum-impl-testing skill to write a deterministic #[tokio::test] that either sends a JSON request via oneshot with the correct Content-Type header or uses axum-test::TestServer with fluent assertions, all built from a shared pub fn app() constructor.
Dependency Matrix
Required Modules
None requiredComponents
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: axum-impl-testing Download link: https://github.com/Impertio-Studio/Axum-Claude-Skill-Package/archive/main.zip#axum-impl-testing Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.