1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Testing utilities for Tideway applications
//!
//! This module provides comprehensive testing tools including:
//! - Alba-style HTTP endpoint testing without running a server
//! - Database testing with SQLite in-memory
//! - Fluent assertion APIs
//!
//! # Example
//!
//! ```rust,no_run
//! use axum::{Router, routing::get, Json};
//! use tideway::testing::{get, post, TestDb};
//! use serde_json::json;
//!
//! async fn hello() -> Json<serde_json::Value> {
//! Json(json!({"message": "Hello!"}))
//! }
//!
//! #[tokio::test]
//! async fn test_hello() {
//! let app = Router::new().route("/hello", get(hello));
//!
//! let response = get(app, "/hello")
//! .execute()
//! .await
//! .assert_ok()
//! .assert_json();
//!
//! let body: serde_json::Value = response.json().await;
//! assert_eq!(body["message"], "Hello!");
//! }
//! ```
pub use TestDb;
pub use ;
pub use ;