Skip to main content

Crate toxi_testing

Crate toxi_testing 

Source
Expand description

Testing utilities for Toxi web applications

This crate provides test helpers, mocks, and utilities for testing Toxi web applications.

§Examples

use toxi_testing::*;

#[tokio::test]
async fn test_endpoint() {
    let request = TestRequest::get("/api/users").build();
    // Test your handlers
}

Re-exports§

pub use request::TestRequest;
pub use request::TestRequestError;
pub use response::TestResponse;
pub use server::TestServer;
pub use server::test_router;

Modules§

request
Test request builder module — provides TestRequest and TestRequestError.
response
Test response wrapper module — provides TestResponse.
server
Test server module — provides TestServer and test_router.

Attribute Macros§

test
Re-export tokio::test for convenience Marks async function to be executed by runtime, suitable to test environment. This macro helps set up a Runtime without requiring the user to use Runtime or Builder directly.