test: deepen and complete project-wide test coverage (#297)

* test: deepen coverage for health doctor provider and tunnels

* test: add broad trait and module re-export coverage
This commit is contained in:
Chummy 2026-02-16 18:58:24 +08:00 committed by GitHub
parent 79a6f180a8
commit 49fcc7a2c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 1156 additions and 0 deletions

View file

@ -1 +1,34 @@
pub mod engine;
#[cfg(test)]
mod tests {
use crate::config::HeartbeatConfig;
use crate::heartbeat::engine::HeartbeatEngine;
use crate::observability::NoopObserver;
use std::sync::Arc;
#[test]
fn heartbeat_engine_is_constructible_via_module_export() {
let temp = tempfile::tempdir().unwrap();
let engine = HeartbeatEngine::new(
HeartbeatConfig::default(),
temp.path().to_path_buf(),
Arc::new(NoopObserver),
);
let _ = engine;
}
#[tokio::test]
async fn ensure_heartbeat_file_creates_expected_file() {
let temp = tempfile::tempdir().unwrap();
let workspace = temp.path();
HeartbeatEngine::ensure_heartbeat_file(workspace)
.await
.unwrap();
let heartbeat_path = workspace.join("HEARTBEAT.md");
assert!(heartbeat_path.exists());
}
}