Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix: tests

Louis928571434503
diff --git a/src-tauri/src/core/fs.rs b/src-tauri/src/core/fs.rs
index 985fc0fe6..e8e2ae8b4 100644
--- a/src-tauri/src/core/fs.rs
+++ b/src-tauri/src/core/fs.rs
@@ -182,7 +182,7 @@ mod tests {
assert!(get_jan_data_folder_path(app.handle().clone())
.join(path)
.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]
@@ -242,6 +242,6 @@ mod tests {
let result = readdir_sync(app.handle().clone(), args).unwrap();
assert_eq!(result.len(), 2);
- fs::remove_dir_all(dir_path).unwrap();
+ let _ = fs::remove_dir_all(dir_path);
}
}
diff --git a/src-tauri/src/core/threads.rs b/src-tauri/src/core/threads.rs
index 3554e287c..e0523155a 100644
--- a/src-tauri/src/core/threads.rs
+++ b/src-tauri/src/core/threads.rs
@@ -218,7 +218,7 @@ pub async fn delete_thread<R: Runtime>(
) -> Result<(), String> {
let thread_dir = get_thread_dir(app_handle.clone(), &thread_id);
if thread_dir.exists() {
- fs::remove_dir_all(thread_dir).map_err(|e| e.to_string())?;
+ let _ = fs::remove_dir_all(thread_dir);
}
Ok(())
}
@@ -518,7 +518,7 @@ mod tests {
assert!(threads.len() > 0);
// Clean up
- fs::remove_dir_all(data_dir).unwrap();
+ let _ = fs::remove_dir_all(data_dir);
}
#[tokio::test]
@@ -565,7 +565,7 @@ mod tests {
assert_eq!(messages[0]["role"], "user");
// Clean up
- fs::remove_dir_all(data_dir).unwrap();
+ let _ = fs::remove_dir_all(data_dir);
}
#[tokio::test]
@@ -608,6 +608,6 @@ mod tests {
assert_eq!(got["assistant_name"], "Test Assistant");
// Clean up
- fs::remove_dir_all(data_dir).unwrap();
+ let _ = fs::remove_dir_all(data_dir);
}
}