salvo-testing

Validate Salvo handlers, middleware, and routing with TestClient.

20|5|Updated Jan 11, 2026
One-click install
npx skills add https://github.com/salvo-rs/salvo-skills --skill salvo-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: salvo-testing
Source: https://github.com/salvo-rs/salvo-skills/tree/main/skills/salvo-testing
Command: npx skills add https://github.com/salvo-rs/salvo-skills --skill salvo-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing and maintaining unit and integration tests for Salvo applications using TestClient ensures reliable, repeatable verification of handlers, middleware, and API endpoints.

Core Features & Use Cases

  • Test isolation: Validate individual handlers and middleware with minimal setup.
  • End-to-end scenarios: Create integration tests covering routing, request flows, and error paths.
  • Example-driven: Demonstrates common testing patterns with TestClient and assertion utilities.

Quick Start

Run a basic test example to verify a simple handler with TestClient.

Frequently Asked Questions about salvo-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write integration tests for a Rust web application using Salvo?

To write integration tests for a Rust web application using Salvo, use the TestClient utility to simulate HTTP requests across diverse routing paths and parameters. This validates end-to-end request flows and error paths within the Tokio async runtime.

What is the best way to isolate and test individual Salvo handlers?

Isolating and testing individual Salvo handlers is best achieved by using TestClient with minimal setup to validate specific handler behaviors. This approach ensures reliable, repeatable verification of your application logic without needing the entire server running.

Can I test Salvo middleware behavior separately from my routes?

Yes, you can test Salvo middleware behavior separately by using TestClient to simulate HTTP requests and assert middleware responses in isolation. This allows you to validate specific middleware logic with minimal setup before integrating it into full routing scenarios.

Do I need the Tokio async runtime to execute Salvo unit tests?

Yes, you need the Tokio async runtime to execute Salvo unit tests. The testing process relies on Tokio to handle the asynchronous execution of HTTP requests simulated by the TestClient utility in Rust.

Why does my TestClient request return unexpected results during end-to-end Salvo testing?

Unexpected results during end-to-end Salvo testing with TestClient often occur when diverse routing paths and request parameters are not fully accounted for. Validate your handler behaviors and error paths against the specific simulated HTTP requests to isolate the issue.