cards/apps/api/tests/health.test.ts
Till 8605b1b517 Phase 0+1: Repo-Skelett für Cards-Greenfield
Strategie B (beschlossen 2026-05-08): Cards wird als eigenständige
föderierte App neu gebaut, ohne Code-Übernahme aus mana-monorepo.

Skelett enthält:
- apps/api: Hono+Bun mit /healthz, /version, Manifest-Endpoint, leere
  pgSchema('cards'), Drizzle-Config, erstem Vitest
- apps/web: SvelteKit 2 + Svelte 5 (runes), Vite auf 3082
- packages/cards-domain: Pure-TS, CardType-Discriminated-Union,
  SubIndex-Granularität für Reviews, Future-CardType-Set vorbereitet
- infrastructure/docker-compose.yml: Postgres 16 auf 5435
- app-manifest.json: v1.0.0, Verein-owned, beta-tier
- .github/workflows/ci.yml
- docs/LESSONS_FROM_MANA_MONOREPO.md (Read-Day-Output, 15 Lehren)

Pre-Flight für Phase 2 (Auth-Föderation): DNS cardecky.mana.how,
GitHub-Repo mana-ev/cards, Cards-App-Registrierung in mana-auth,
NPM_AUTH_TOKEN für Verdaccio.

Plan: mana/docs/playbooks/CARDS_GREENFIELD.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 14:08:41 +02:00

24 lines
783 B
TypeScript

import { describe, it, expect } from 'vitest';
import { Hono } from 'hono';
import { healthRoute } from '../src/routes/health.ts';
describe('health routes', () => {
const app = new Hono();
app.route('/', healthRoute);
it('GET /healthz returns ok', async () => {
const res = await app.request('/healthz');
expect(res.status).toBe(200);
const body = (await res.json()) as { status: string };
expect(body.status).toBe('ok');
});
it('GET /version returns app + version + build', async () => {
const res = await app.request('/version');
expect(res.status).toBe(200);
const body = (await res.json()) as { app: string; version: string; build: string };
expect(body.app).toBe('cards');
expect(body.version).toBeTruthy();
expect(body.build).toBeTruthy();
});
});