53 lines
1.7 KiB
TypeScript
53 lines
1.7 KiB
TypeScript
import react from "@vitejs/plugin-react";
|
|
import { defineConfig } from "vitest/config";
|
|
|
|
/**
|
|
* Standalone Vitest config — bypasses `createTestConfig` because we need the
|
|
* `@vitejs/plugin-react` plugin to transform `.tsx` test + source files (JSX
|
|
* runtime). Mirrors the canonical genesis shape (forks pool, polyfills setup,
|
|
* istanbul 100% thresholds) as documented in CLAUDE.md.
|
|
*/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
test: {
|
|
globals: false,
|
|
environment: "happy-dom",
|
|
pool: "forks",
|
|
fileParallelism: false,
|
|
setupFiles: ["@suaveplan/testing/polyfills", "./src/test-setup.ts"],
|
|
include: [
|
|
"src/**/*.test.ts",
|
|
"src/**/*.test.tsx",
|
|
"tests/**/*.test.ts",
|
|
"tests/**/*.test.tsx",
|
|
],
|
|
exclude: ["dist/**", "node_modules/**", "src/__benchmarks__/**"],
|
|
testTimeout: 5000,
|
|
hookTimeout: 5000,
|
|
coverage: {
|
|
provider: "istanbul",
|
|
reporter: ["text", "html", "lcov"],
|
|
include: ["src/**/*.ts", "src/**/*.tsx"],
|
|
exclude: [
|
|
"src/**/*.test.ts",
|
|
"src/**/*.test.tsx",
|
|
"src/**/*.bench.ts",
|
|
"src/**/*.schemas.ts",
|
|
"src/**/*.types.ts",
|
|
"src/**/index.ts",
|
|
"src/**/*.stories.tsx",
|
|
"src/__benchmarks__/**",
|
|
"src/test-utils.tsx",
|
|
"src/test-setup.ts",
|
|
"tests/**",
|
|
],
|
|
thresholds: {
|
|
statements: 100,
|
|
branches: 100,
|
|
functions: 100,
|
|
lines: 100,
|
|
},
|
|
},
|
|
},
|
|
});
|