2026-02-14 11:47:26 +01:00
|
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
|
import path from 'path';
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
test: {
|
2026-09-22 14:12:13 +02:00
|
|
|
// Node stays the default: almost everything under test is plain logic and
|
|
|
|
|
// does not need a DOM. A component test opts in per file with
|
|
|
|
|
// `// @vitest-environment jsdom` in its first docblock (see
|
|
|
|
|
// components/__tests__ for examples), which keeps the fast path fast.
|
2026-02-14 11:47:26 +01:00
|
|
|
environment: 'node',
|
2026-09-29 22:50:30 +02:00
|
|
|
setupFiles: ['./vitest.setup.ts', './vitest.content-guard.ts'],
|
2026-08-30 15:11:25 +02:00
|
|
|
include: [
|
2026-09-22 14:12:13 +02:00
|
|
|
'lib/__tests__/**/*.test.{ts,tsx}',
|
|
|
|
|
'app/**/__tests__/**/*.test.{ts,tsx}',
|
|
|
|
|
'components/__tests__/**/*.test.{ts,tsx}',
|
|
|
|
|
'scripts/__tests__/**/*.test.{ts,tsx}',
|
2026-08-30 15:11:25 +02:00
|
|
|
],
|
2026-02-14 11:47:26 +01:00
|
|
|
coverage: {
|
|
|
|
|
provider: 'v8',
|
|
|
|
|
include: ['lib/**/*.ts'],
|
|
|
|
|
exclude: ['lib/__tests__/**'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
resolve: {
|
|
|
|
|
alias: {
|
|
|
|
|
'@': path.resolve(__dirname, '.'),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
});
|