fix: test command

This commit is contained in:
Louis 2025-08-10 23:36:14 +07:00
parent f0a9080ef7
commit 59afafba0e
3 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -30,7 +30,6 @@ test-tauri = [
"tauri/test",
]
[build-dependencies]
tauri-build = { version = "2.0.2", features = [] }

View File

@ -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);
}