diff --git a/ldk-server/src/util/config.rs b/ldk-server/src/util/config.rs index bc246f0..184c96d 100644 --- a/ldk-server/src/util/config.rs +++ b/ldk-server/src/util/config.rs @@ -20,12 +20,19 @@ use ldk_node::liquidity::LSPS2ServiceConfig; use log::LevelFilter; use serde::{Deserialize, Serialize}; -use crate::get_default_data_dir; - +#[cfg(not(test))] const DEFAULT_CONFIG_FILE: &str = "config.toml"; fn get_default_config_path() -> Option { - get_default_data_dir().map(|data_dir| data_dir.join(DEFAULT_CONFIG_FILE)) + // Skip the default config path during tests to avoid picking up a real ~/.ldk-server/config.toml locally + #[cfg(not(test))] + { + crate::get_default_data_dir().map(|data_dir| data_dir.join(DEFAULT_CONFIG_FILE)) + } + #[cfg(test)] + { + None + } } /// Configuration for LDK Server.