spawn app for each integration test
also adds missing dep to flake
This commit is contained in:
@ -1,18 +1,11 @@
|
||||
mod common;
|
||||
use common::spawn_app;
|
||||
use reqwest::StatusCode;
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_healthcheck() -> reqwest::Result<()> {
|
||||
let response = reqwest::get("http://localhost:7000/healthcheck").await?;
|
||||
|
||||
assert_eq!(response.status(), StatusCode::OK);
|
||||
assert_eq!(response.text().await?, r#"{"healthy":true}"#);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_healthcheck2() -> reqwest::Result<()> {
|
||||
let response = reqwest::get("http://localhost:7000/healthcheck").await?;
|
||||
let address = spawn_app();
|
||||
let response = reqwest::get(format!("{address}/api/healthcheck")).await?;
|
||||
|
||||
assert_eq!(response.status(), StatusCode::OK);
|
||||
assert_eq!(response.text().await?, r#"{"healthy":true}"#);
|
||||
|
||||
Reference in New Issue
Block a user