fix: tests

This commit is contained in:
Louis 2025-08-07 22:37:43 +07:00
parent bdec0af791
commit 9285714345
No known key found for this signature in database
GPG Key ID: 44FA9F4D33C37DE2
2 changed files with 6 additions and 6 deletions

View File

@ -182,7 +182,7 @@ mod tests {
assert!(get_jan_data_folder_path(app.handle().clone()) assert!(get_jan_data_folder_path(app.handle().clone())
.join(path) .join(path)
.exists()); .exists());
fs::remove_dir_all(get_jan_data_folder_path(app.handle().clone()).join(path)).unwrap(); let _ = fs::remove_dir_all(get_jan_data_folder_path(app.handle().clone()).join(path));
} }
#[test] #[test]
@ -242,6 +242,6 @@ mod tests {
let result = readdir_sync(app.handle().clone(), args).unwrap(); let result = readdir_sync(app.handle().clone(), args).unwrap();
assert_eq!(result.len(), 2); assert_eq!(result.len(), 2);
fs::remove_dir_all(dir_path).unwrap(); let _ = fs::remove_dir_all(dir_path);
} }
} }

View File

@ -218,7 +218,7 @@ pub async fn delete_thread<R: Runtime>(
) -> Result<(), String> { ) -> Result<(), String> {
let thread_dir = get_thread_dir(app_handle.clone(), &thread_id); let thread_dir = get_thread_dir(app_handle.clone(), &thread_id);
if thread_dir.exists() { if thread_dir.exists() {
fs::remove_dir_all(thread_dir).map_err(|e| e.to_string())?; let _ = fs::remove_dir_all(thread_dir);
} }
Ok(()) Ok(())
} }
@ -518,7 +518,7 @@ mod tests {
assert!(threads.len() > 0); assert!(threads.len() > 0);
// Clean up // Clean up
fs::remove_dir_all(data_dir).unwrap(); let _ = fs::remove_dir_all(data_dir);
} }
#[tokio::test] #[tokio::test]
@ -565,7 +565,7 @@ mod tests {
assert_eq!(messages[0]["role"], "user"); assert_eq!(messages[0]["role"], "user");
// Clean up // Clean up
fs::remove_dir_all(data_dir).unwrap(); let _ = fs::remove_dir_all(data_dir);
} }
#[tokio::test] #[tokio::test]
@ -608,6 +608,6 @@ mod tests {
assert_eq!(got["assistant_name"], "Test Assistant"); assert_eq!(got["assistant_name"], "Test Assistant");
// Clean up // Clean up
fs::remove_dir_all(data_dir).unwrap(); let _ = fs::remove_dir_all(data_dir);
} }
} }