mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-01 03:55:22 +02:00
- Changed the setup file path for global mocks in the Vitest configuration to a more explicit location, improving clarity and organization of test setup.
36 lines
895 B
TypeScript
36 lines
895 B
TypeScript
import path from "node:path";
|
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
import { defineConfig } from "vitest/config";
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
include: ["__test__/**/*.test.ts"], // Incluir solo los archivos de test en el directorio __test__
|
|
exclude: ["**/node_modules/**", "**/dist/**", "**/.docker/**"],
|
|
pool: "forks",
|
|
// Se ejecuta antes de todos los tests y aplica mocks globales (db, postgres, etc.)
|
|
setupFiles: ["./__test__/setup/mock-db.ts"],
|
|
},
|
|
define: {
|
|
"process.env": {
|
|
NODE: "test",
|
|
GITHUB_CLIENT_ID: "test",
|
|
GITHUB_CLIENT_SECRET: "test",
|
|
GOOGLE_CLIENT_ID: "test",
|
|
GOOGLE_CLIENT_SECRET: "test",
|
|
},
|
|
},
|
|
plugins: [
|
|
tsconfigPaths({
|
|
projects: [path.resolve(__dirname, "../tsconfig.json")],
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@dokploy/server": path.resolve(
|
|
__dirname,
|
|
"../../../packages/server/src",
|
|
),
|
|
},
|
|
},
|
|
});
|