Incorpora y revisa código para pruebas unitarias

This commit is contained in:
Manuel Cillero 2024-12-05 14:32:10 +01:00
parent 7e08c89e17
commit c15c839cd2
9 changed files with 31 additions and 14 deletions

2
tests/main.rs Normal file
View file

@ -0,0 +1,2 @@
#[cfg(test)]
mod server;

View file

@ -0,0 +1,14 @@
use pagetop::prelude::*;
struct HealthCheck;
impl PackageTrait for HealthCheck {}
#[pagetop::test]
async fn health_check_works() {
let app = service::test::init_service(Application::prepare(&HealthCheck).test()).await;
let req = service::test::TestRequest::get().uri("/").to_request();
let _resp = service::test::call_service(&app, req).await;
// assert_eq!("OK", "OK");
}

1
tests/server/mod.rs Normal file
View file

@ -0,0 +1 @@
mod health_check;