Files
EpicNext-Cms/vitest.config.ts
T
openhands 914d7377ee
Gitea Actions Runner Test / test-job (push) Successful in 1s
CI / check (push) Failing after 20s
CI / tests-unit (push) Skipped
CI / tests-integration (push) Skipped
CI / tests-ui (push) Skipped
CI / preflight (push) Skipped
CI / deploy (push) Skipped
chore: upgrade to pnpm v12, update dependencies, and fix msw v3 typescript types
2026-10-02 21:57:10 +02:00

58 lines
1.5 KiB
TypeScript

import { fileURLToPath } from "node:url";
import { defineConfig } from "vitest/config";
// Local config so Vitest does not walk up into the parent Laravel repo's
// vite.config.js (this app lives inside the Laravel project tree).
export default defineConfig({
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
// server-only throws in Node; tests don't need the Next client guard.
"server-only": fileURLToPath(
new URL("./src/test/server-only-stub.ts", import.meta.url),
),
},
},
test: { setupFiles: ["./vitest.setup.ts"],
environment: "node",
// Preserve module-initialization calls used by route permission contract tests.
clearMocks: false,
// Modules under test transitively import @/env; skip its strict parse so
// unit tests run without a populated .env.
env: {
SKIP_ENV_VALIDATION: "1",
HOTEL_NAME: "TestHotel",
DATABASE_URL: "mysql://root:root@localhost:3306/test",
},
testTimeout: 10000,
exclude: [
"integration/**",
"e2e/**",
"node_modules/**",
".next/**",
".next.prev/**",
],
coverage: {
enabled: true,
provider: "v8",
reporter: ["text", "lcov", "html"],
thresholds: {
statements: 12,
branches: 9,
functions: 10,
lines: 13,
},
include: ["src/**/*.{ts,tsx}"],
exclude: [
"src/generated/**",
"src/**/*.test.ts",
"src/**/*.test.tsx",
"src/**/*-client.tsx",
"src/**/*-widget.tsx",
"src/types/**",
"src/test/**",
],
},
},
});