use std::sync::Once;
use tokio::runtime::Runtime;
use tracing::Level;
use tracing_subscriber::FmtSubscriber;
static INIT: Once = Once::new();
pub fn setup_test_env() {
INIT.call_once(|| {
let _subscriber = FmtSubscriber::builder()
.with_max_level(Level::DEBUG)
.with_test_writer()
.init();
std::env::set_var("ENVIRONMENT", "test");
std::env::set_var("DATABASE_URL", "sqlite::memory:");
});
}
pub fn get_test_runtime() -> Runtime {
Runtime::new().expect("Failed to create Tokio runtime")
}
#[cfg(test)]
mod tests {
#[test]
fn lib_rs_stub() {
assert!(true, "tests/lib.rs is stubbed");
}
}