CI / check (push) Successful in 31s
CI / tests-integration (push) Successful in 2m4s
CI / tests-unit (push) Successful in 2m16s
CI / tests-imaging-browsers (push) Successful in 1m30s
CI / tests-quality (push) Successful in 54s
CI / tests-ui (push) Successful in 3m1s
CI / preflight (push) Skipped
CI / deploy (push) Successful in 3m24s
Allow mode: enforce in the report config, fail the command on over-budget and unavailable routes, and make the markdown wording follow the configured mode. Recalibrate the budgets against the webpack build (baseline x1.15, rounded up to the next 10 KiB) now that the old Turbopack numbers no longer apply, so the Docker image build gate blocks genuine bundle regressions instead of only warning. Raise the Vitest coverage thresholds to the measured floor (37.17/30.1/31.79/38.17 -> 36/29/30/37).
59 lines
1.5 KiB
TypeScript
59 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: 36,
|
|
branches: 29,
|
|
functions: 30,
|
|
lines: 37,
|
|
},
|
|
include: ["src/**/*.{ts,tsx}"],
|
|
exclude: [
|
|
"src/generated/**",
|
|
"src/**/*.test.ts",
|
|
"src/**/*.test.tsx",
|
|
"src/**/*-client.tsx",
|
|
"src/**/*-widget.tsx",
|
|
"src/types/**",
|
|
"src/test/**",
|
|
],
|
|
},
|
|
},
|
|
});
|