toxi_testing/lib.rs
1//! Testing utilities for Toxi web applications
2//!
3//! This crate provides test helpers, mocks, and utilities for testing
4//! Toxi web applications.
5//!
6//! # Examples
7//!
8//! ```no_run
9//! use toxi_testing::*;
10//!
11//! #[tokio::test]
12//! async fn test_endpoint() {
13//! let request = TestRequest::get("/api/users").build();
14//! // Test your handlers
15//! }
16//! ```
17
18/// Test request builder module — provides [`TestRequest`] and [`TestRequestError`].
19pub mod request;
20/// Test response wrapper module — provides [`TestResponse`].
21pub mod response;
22/// Test server module — provides [`TestServer`] and [`test_router`].
23pub mod server;
24
25/// Re-export [`TestRequest`] and [`TestRequestError`] at crate root.
26pub use request::{TestRequest, TestRequestError};
27/// Re-export [`TestResponse`] at crate root.
28pub use response::TestResponse;
29/// Re-export [`TestServer`] and [`test_router`] at crate root.
30pub use server::{TestServer, test_router};
31
32/// Re-export tokio::test for convenience
33pub use tokio::test;