MeshiTrack/packages/web/vitest.config.ts

48 lines
1.2 KiB
TypeScript
Raw Normal View History

import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import path from 'path';
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@/': path.resolve(import.meta.dirname, 'src') + '/',
'@meshitrack/shared': path.resolve(import.meta.dirname, '../shared/src'),
},
extensions: ['.ts', '.tsx', '.js', '.jsx'],
},
test: {
globals: true,
environment: 'jsdom',
2026-05-19 11:06:03 +09:00
include: ['tests/**/*.test.{ts,tsx}'],
setupFiles: ['./vitest.setup.ts'],
css: false,
coverage: {
provider: 'v8',
enabled: false,
2026-05-14 14:47:23 +09:00
// @ts-expect-error -- v8 provider supports `all` but types lag behind
all: true,
include: ['src/**/*.{ts,tsx}'],
exclude: [
'src/test-utils.tsx',
'src/app/layout.tsx',
'src/app/api/**',
'src/lib/auth.ts',
'src/proxy.ts',
'src/**/*.d.ts',
'src/app/(dashboard)/layout.tsx',
'src/app/login/**',
],
reporter: ['text', 'lcov', 'json-summary', 'html'],
reportsDirectory: './coverage',
thresholds: {
2026-05-14 14:47:23 +09:00
lines: 90,
functions: 85,
branches: 75,
statements: 85,
},
},
testTimeout: 10_000,
},
});