refactor: migration architecture clean (Rust + JS)

Côté JS : décompose main.js en modules ES6 (state, services, ui, router)
pour séparer les responsabilités et faciliter la maintenance.
Côté Rust : ajoute 7 tests sur is_relevant_path (notify_watcher)
pour couvrir les cas cachés/non-md ; couverture totale 77 % > seuil 60 %.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-19 14:23:30 +02:00
parent 6ae7a434c4
commit cdafffaa70
12 changed files with 384 additions and 313 deletions
@@ -64,3 +64,44 @@ fn is_relevant_path(path: &Path) -> bool {
}
path.extension().is_some_and(|e| e == "md")
}
#[cfg(test)]
mod tests {
use super::*;
use std::path::Path;
#[test]
fn relevant_path_md_file() {
assert!(is_relevant_path(Path::new("/docs/notes.md")));
}
#[test]
fn relevant_path_nested_md() {
assert!(is_relevant_path(Path::new("/wiki/section/page.md")));
}
#[test]
fn irrelevant_path_txt_extension() {
assert!(!is_relevant_path(Path::new("/docs/readme.txt")));
}
#[test]
fn irrelevant_path_no_extension() {
assert!(!is_relevant_path(Path::new("/docs/makefile")));
}
#[test]
fn irrelevant_path_hidden_file() {
assert!(!is_relevant_path(Path::new("/docs/.hidden.md")));
}
#[test]
fn irrelevant_path_hidden_dir() {
assert!(!is_relevant_path(Path::new("/docs/.git/file.md")));
}
#[test]
fn irrelevant_path_hidden_dir_at_root() {
assert!(!is_relevant_path(Path::new(".hidden/file.md")));
}
}