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: test command

Louis59afafba0eef
diff --git a/Makefile b/Makefile
index 9707b2815..682df784f 100644
--- a/Makefile
+++ b/Makefile
@@ -43,7 +43,7 @@ test: lint
yarn test
yarn copy:assets:tauri
yarn build:icon
- cargo test --manifest-path src-tauri/Cargo.toml --no-default-features --features test-tauri
+ cargo test --manifest-path src-tauri/Cargo.toml --no-default-features --features test-tauri -- --test-threads=1
# Builds and publishes the app
build-and-publish: install-and-build
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index 4f93bd601..bcdedcc8a 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -30,7 +30,6 @@ test-tauri = [
"tauri/test",
]
-
[build-dependencies]
tauri-build = { version = "2.0.2", features = [] }
diff --git a/src-tauri/src/core/cmd.rs b/src-tauri/src/core/cmd.rs
index 7e5589b0b..2ebe031f1 100644
--- a/src-tauri/src/core/cmd.rs
+++ b/src-tauri/src/core/cmd.rs
@@ -94,7 +94,9 @@ pub fn update_app_configuration(
#[tauri::command]
pub fn get_jan_data_folder_path<R: Runtime>(app_handle: tauri::AppHandle<R>) -> PathBuf {
if cfg!(test) {
- let path = PathBuf::from("test-data");
+ let path = std::env::current_dir()
+ .unwrap_or_else(|_| PathBuf::from("."))
+ .join("test-data");
if !path.exists() {
let _ = fs::create_dir_all(&path);
}