Define la estructura para tests y ejemplos

This commit is contained in:
Manuel Cillero 2023-06-09 10:33:54 +02:00
parent cd76355430
commit 0af85c4d77
14 changed files with 74 additions and 24 deletions

18
tests/Cargo.toml Normal file
View file

@ -0,0 +1,18 @@
[package]
name = "tests"
version = "0.0.1"
edition = "2021"
authors = [
"Manuel Cillero <manuel@cillero.es>"
]
description = """\
Test for PageTop.\
"""
homepage = "https://pagetop.cillero.es"
repository = "https://github.com/manuelcillero/pagetop"
license = "Apache-2.0 OR MIT"
[dependencies]
actix-web = "4"
pagetop = { version = "0.0", path = "../pagetop", features = ["mysql"], default-features = false }

1
tests/src/main.rs Normal file
View file

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

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

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

View file

@ -0,0 +1,15 @@
use pagetop::prelude::*;
struct HealthCheck;
impl ModuleTrait for HealthCheck {}
async fn spawn_app() {
let server = Application::prepare(&HealthCheck).unwrap().server();
let _ = actix_web::rt::spawn(server);
}
#[actix_web::test]
async fn health_check_works() {
spawn_app();
}