Add mocked unit tests for REST API route handlers

Tests the full handler flow with mocked DB: auth guard (401), Zod
validation (400), successful responses, and 404s for missing resources.
Also adds ~ alias resolution to Journal vitest config.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-04-13 00:59:45 +02:00
parent 234ab9f8c5
commit 55463d1f56
No known key found for this signature in database
GPG key ID: A32FF691A0F752D9
2 changed files with 177 additions and 1 deletions

View file

@ -1 +1,11 @@
export { default } from "../../vitest.shared.ts";
import { defineConfig, mergeConfig } from "vitest/config";
import shared from "../../vitest.shared.ts";
import { resolve } from "node:path";
export default mergeConfig(shared, defineConfig({
resolve: {
alias: {
"~": resolve(import.meta.dirname, "app"),
},
},
}));