axum-impl-testing

Installation
SKILL.md

Axum Testing

Overview

Axum testing has two complementary approaches. Both drive a Router without binding a real network socket, so tests are fast and deterministic.

  1. tower::ServiceExt::oneshot : the zero-extra-crate approach. A Router already implements tower::Service<Request<Body>>, so it can be called directly. This is what the official examples/testing crate uses.
  2. axum-test TestServer : an ergonomic wrapper. It builds requests with chainable helpers (.json(), .add_header()) and exposes fluent assertion methods (assert_status_ok, assert_json, assert_text).

Neither replaces the other. ALWAYS build both kinds of test on top of ONE shared app() constructor so every test exercises the real app wiring.

Installs
5
First Seen
Aug 13, 2026
axum-impl-testing — impertio-studio/axum-claude-skill-package