import path from "node:path"; import { fileURLToPath } from "node:url"; import { defineConfig } from "vitest/config"; const rootDirectory = path.dirname(fileURLToPath(import.meta.url)); export default defineConfig({ resolve: { alias: { "@": path.join(rootDirectory, "src"), "server-only": path.join(rootDirectory, "src/test/server-only.ts"), }, }, test: { environment: "node", setupFiles: ["src/test/dom-shims.ts"], env: { DATABASE_URL: "postgres://db/portal", BETTER_AUTH_SECRET: "test-secret-at-least-thirty-two-characters", BETTER_AUTH_URL: "http://localhost:3000", IMMICH_BASE_URL: "http://immich:2283", IMMICH_API_KEY: "test-immich-key", SMTP_HOST: "smtp.example.com", SMTP_PORT: "587", SMTP_USER: "portal@example.com", SMTP_PASSWORD: "test-smtp-password", SMTP_FROM: "portal@example.com", LEGAL_IMPRINT_URL: "https://example.com/impressum", LEGAL_PRIVACY_URL: "https://example.com/datenschutz", LEGAL_TERMS_URL: "https://example.com/nutzungsbedingungen", }, include: ["src/**/*.test.ts", "src/**/*.test.tsx", "tests/**/*.test.ts"], }, });