From 8fba0fc7099b677f2ffa1e935a6b1932877833f7 Mon Sep 17 00:00:00 2001 From: n08i40k Date: Fri, 13 Jun 2025 01:03:06 +0400 Subject: [PATCH] feat(env): add ability to set custom .env file for testing on local machine --- src/test_env.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test_env.rs b/src/test_env.rs index 0f82e24..26b2edc 100644 --- a/src/test_env.rs +++ b/src/test_env.rs @@ -9,7 +9,9 @@ pub(crate) mod tests { pub fn test_env() { 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 {