mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-04-18 17:33:08 +08:00
fix: resolve test failures and clippy warnings
- tests/App.test.tsx: remove outdated SettingsPage mock, use dynamic import - database/tests.rs: remove unused field, use struct init syntax - deeplink/tests.rs: use idiomatic assert!() instead of assert_eq!(true) - support.rs: add #[allow(dead_code)] for test utilities - usage_stats.rs: code formatting
This commit is contained in:
@@ -49,6 +49,7 @@ pub fn test_mutex() -> &'static Mutex<()> {
|
||||
}
|
||||
|
||||
/// 创建测试用的 AppState,包含一个空的数据库
|
||||
#[allow(dead_code)]
|
||||
pub fn create_test_state() -> Result<AppState, Box<dyn std::error::Error>> {
|
||||
let db = Arc::new(Database::init()?);
|
||||
let proxy_service = ProxyService::new(db.clone());
|
||||
@@ -56,6 +57,7 @@ pub fn create_test_state() -> Result<AppState, Box<dyn std::error::Error>> {
|
||||
}
|
||||
|
||||
/// 创建测试用的 AppState,并从 MultiAppConfig 迁移数据
|
||||
#[allow(dead_code)]
|
||||
pub fn create_test_state_with_config(
|
||||
config: &MultiAppConfig,
|
||||
) -> Result<AppState, Box<dyn std::error::Error>> {
|
||||
|
||||
Reference in New Issue
Block a user