chore(server): scaffold axum com health endpoint e testes

This commit is contained in:
2026-08-05 20:23:09 -03:00
parent bfe12ba7ae
commit bc4de69ab9
11 changed files with 2013 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
use axum_test::TestServer;
use ares_server::config::Config;
use ares_server::{build_app, router};
use tempfile::tempdir;
#[tokio::test]
async fn health_returns_ok() {
let dir = tempdir().unwrap();
let cfg = Config {
db_path: dir.path().join("t.db").to_string_lossy().into(),
..Default::default()
};
let state = build_app(cfg).await;
let server = TestServer::new(router(state));
let res = server.get("/api/v1/health").await;
assert_eq!(res.status_code(), 200);
assert_eq!(res.json::<serde_json::Value>()["status"], "ok");
}