Skip to main content

Module testing

Module testing 

Source
Expand description

Testing utilities for database operations

Provides TestDatabase for setting up isolated test environments with in-memory SQLite databases and automatic migration support.

§Example

use ferro_rs::test_database;

#[tokio::test]
async fn test_create_user() {
    let db = test_database!();

    // Your test code here - actions using DB::connection()
    // will automatically use this test database
}

Structs§

TestDatabase
Test database wrapper that provides isolated database environments