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:
parent
234ab9f8c5
commit
55463d1f56
2 changed files with 177 additions and 1 deletions
|
|
@ -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"),
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue