feat(env): add ability to set custom .env file for testing on local machine

This commit is contained in:
2025-06-13 01:03:06 +04:00
parent 983ff4fa5e
commit 8fba0fc709

View File

@@ -9,7 +9,9 @@ pub(crate) mod tests {
pub fn test_env() { pub fn test_env() {
info!("Loading test environment file..."); info!("Loading test environment file...");
dotenvy::from_path(".env.test").expect("Failed to load test environment file"); dotenvy::from_filename(".env.test.local")
.or_else(|_| dotenvy::from_filename(".env.test"))
.expect("Failed to load test environment file");
} }
pub async fn test_app_state() -> web::Data<AppState> { pub async fn test_app_state() -> web::Data<AppState> {