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:
parent
79a6f180a8
commit
49fcc7a2c4
21 changed files with 1156 additions and 0 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue