feat(e2e): add test mode infrastructure with BTERMINAL_TEST env isolation

Rust: watcher.rs/fs_watcher.rs skip watchers in test mode,
is_test_mode Tauri command. Frontend: wake-scheduler disable,
App.svelte test mode detection. AppConfig centralization in
bterminal-core (OnceLock pattern for path overrides).
This commit is contained in:
Hibryda 2026-03-12 02:52:14 +01:00
parent d1a4d9f220
commit 4097253921
18 changed files with 346 additions and 29 deletions

View file

@ -26,7 +26,7 @@ pub struct MemoraDb {
}
impl MemoraDb {
fn db_path() -> std::path::PathBuf {
fn default_db_path() -> std::path::PathBuf {
dirs::data_dir()
.unwrap_or_else(|| dirs::home_dir().unwrap_or_default().join(".local/share"))
.join("memora")
@ -34,8 +34,11 @@ impl MemoraDb {
}
pub fn new() -> Self {
let db_path = Self::db_path();
Self::new_with_path(Self::default_db_path())
}
/// Create a MemoraDb with a custom database path (for test isolation).
pub fn new_with_path(db_path: std::path::PathBuf) -> Self {
let conn = if db_path.exists() {
Connection::open_with_flags(
&db_path,