Files
pse.dev/vitest.config.mjs
Kalidou Diagne 7b4084c4f7 feat: add basic tests (#542)
* feat: add basic tests
2025-08-11 12:36:12 +02:00

60 lines
1.3 KiB
JavaScript

/// <reference types="vitest" />
import react from "@vitejs/plugin-react"
import path from "path"
import { defineConfig } from "vitest/config"
import { fileURLToPath } from "url"
const __dirname = path.dirname(fileURLToPath(import.meta.url))
export default defineConfig({
plugins: [react()],
test: {
globals: true,
environment: "jsdom",
setupFiles: ["./tests/setup.tsx"],
include: ["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
exclude: [
"**/node_modules/**",
"**/dist/**",
"**/.next/**",
"**/coverage/**",
"**/.git/**",
],
css: true,
reporters: ["verbose"],
coverage: {
provider: "v8",
reporter: ["text", "json", "html"],
exclude: [
"coverage/**",
"dist/**",
"**/node_modules/**",
".next/**",
"**/*.d.ts",
"**/*.config.{js,ts,mjs}",
"**/tests/**",
"**/__tests__/**",
"**/*.test.{js,ts,jsx,tsx}",
"**/*.spec.{js,ts,jsx,tsx}",
],
},
server: {
deps: {
inline: ["vitest-canvas-mock"],
},
},
env: {
NODE_ENV: "test",
},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./"),
},
},
css: {
modules: {
classNameStrategy: "non-scoped",
},
},
})