Files
goodgo-platform/apps/web/vitest.config.ts
Ho Ngoc Hai 0924f0cb9b test(web): add middleware + i18n + messages test suites (GOO-60)
Cover frontend middleware auth/locale logic, i18n config/routing/request/navigation,
and vi/en message parity — 91 new tests across 6 files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-23 10:47:30 +07:00

52 lines
1.3 KiB
TypeScript

import path from 'path';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vitest/config';
export default defineConfig({
plugins: [react()],
test: {
include: ['**/__tests__/**/*.spec.ts', '**/__tests__/**/*.test.ts', '**/__tests__/**/*.spec.tsx', '**/__tests__/**/*.test.tsx'],
exclude: ['**/node_modules/**'],
environment: 'jsdom',
setupFiles: ['./vitest.setup.ts'],
globals: true,
coverage: {
provider: 'v8',
reporter: ['text', 'text-summary', 'json-summary', 'lcov', 'clover'],
reportsDirectory: './coverage',
include: [
'app/**/*.ts',
'app/**/*.tsx',
'components/**/*.ts',
'components/**/*.tsx',
'lib/**/*.ts',
'hooks/**/*.ts',
],
exclude: [
'**/*.spec.ts',
'**/*.spec.tsx',
'**/*.test.ts',
'**/*.test.tsx',
'**/__tests__/**',
'**/__mocks__/**',
'**/node_modules/**',
'app/**/layout.tsx',
'app/**/loading.tsx',
'app/**/error.tsx',
'app/**/not-found.tsx',
],
thresholds: {
statements: 60,
branches: 50,
functions: 60,
lines: 60,
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, '.'),
},
},
});