trillium-testing 0.8.0

testing library for trillium applications
Documentation

๐Ÿงช trillium-testing โ€” test utilities for Trillium apps

ci crates.io version docs.rs

Testing utilities for Trillium applications. Provides assertion macros (assert_ok!, assert_status!, assert_response!, assert_not_handled!), a TestConn builder for constructing requests, and a synchronous test runner โ€” no real TCP listener needed. Enable one of the tokio, smol, or async-std cargo features to select the async runtime.

Example

use trillium::Conn;
use trillium_testing::prelude::*;

async fn handler(conn: Conn) -> Conn {
    conn.ok("hello testing")
}

assert_ok!(get("/").on(&handler), "hello testing");
assert_not_handled!(get("/").on(&()));

Safety

This crate uses #![forbid(unsafe_code)].

License