WP-00: project skeleton with three-level test harness
Cargo workspace (domain, application, infrastructure, api), axum health endpoint with SPA fallback, Vue 3 + Tailwind frontend, Vitest, Playwright, Makefile, Gitea Actions CI and README. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
18
backend/crates/api/src/test_support.rs
Normal file
18
backend/crates/api/src/test_support.rs
Normal file
@ -0,0 +1,18 @@
|
||||
//! Helpers to build a fully wired app on an in-memory database for integration tests.
|
||||
use crate::{build_app, AppState, Config};
|
||||
use axum::Router;
|
||||
|
||||
pub fn test_config() -> Config {
|
||||
Config {
|
||||
database_url: "sqlite::memory:".into(),
|
||||
jwt_secret: "test-secret-test-secret-test-secret-1234".into(),
|
||||
bind: "127.0.0.1:0".parse().unwrap(),
|
||||
bootstrap_admin: None,
|
||||
cookie_secure: false,
|
||||
frontend_dir: "/nonexistent".into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn build_test_app() -> Router {
|
||||
build_app(AppState { cfg: test_config() })
|
||||
}
|
||||
Reference in New Issue
Block a user