Files
suaveplan/packages/threejs/r3f/r3f-networking/vitest.config.ts
2026-05-27 23:47:53 +01:00

57 lines
1.7 KiB
TypeScript

import react from "@vitejs/plugin-react";
import { defineConfig } from "vitest/config";
export default defineConfig({
plugins: [react()],
test: {
globals: false,
environment: "happy-dom",
pool: "forks",
fileParallelism: false,
setupFiles: [
"@suaveplan/testing/polyfills",
"./tests/setup/polyfills.ts",
],
include: [
"src/**/*.test.ts",
"src/**/*.test.tsx",
"tests/**/*.test.ts",
],
exclude: [
"src/__benchmarks__/**",
"benchmarks/**",
"e2e/**",
"dist/**",
"node_modules/**",
],
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/**/*.stories.tsx",
"src/**/index.ts",
// R3F components require <Canvas> at runtime which cannot be
// mounted under happy-dom (WebGL unavailable). The pure
// per-frame logic lives in `apply-networked-frame.ts` and is
// 100% covered.
"src/components/networked-entity/networked-entity.tsx",
"src/__benchmarks__/**",
"tests/**",
],
thresholds: {
statements: 100,
branches: 100,
functions: 100,
lines: 100,
},
},
testTimeout: 5000,
},
});