axum-impl-testing

Official

Test Axum apps reliably with real wiring

AuthorImpertio-Studio
Version1.0.0
Installs0

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() (or pub fn app(...)) so tests prove the real shipped wiring.
  • Two deterministic testing approaches: Use tower::ServiceExt::oneshot for fast handler/unit tests or axum-test::TestServer for ergonomic integration tests with fluent assertions.
  • Correct JSON and body reading: Set Content-Type: application/json for raw JSON oneshot requests to avoid MissingJsonContentType/415, and always read response bodies via into_body() + http_body_util::BodyExt::collect() before inspecting bytes.
  • Multi-request sequencing: Use .into_service() plus ready()/call() when you need multiple requests against one app instance.
  • Integration test visibility: Export app() from src/lib.rs so tests/ 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 required

Components

references

💻 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.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.