vibetunnel/web/vitest.config.ts
Helmut Januschka 5a4b939564
Fix URL link detection for wrapped URLs on mobile terminals (#85)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2025-06-26 22:37:49 +02:00

65 lines
No EOL
1.8 KiB
TypeScript

import { defineConfig } from 'vitest/config';
import path from 'path';
// For Vitest 3.x, we need to use workspace configuration instead of projects
// Create separate configs that can be selected via CLI flags
export default defineConfig(({ mode }) => {
const isClient = mode === 'client' || process.env.VITEST_MODE === 'client';
const isServer = mode === 'server' || process.env.VITEST_MODE === 'server';
// Default to running all tests if no mode specified
const testInclude = isClient
? ['src/client/**/*.test.ts']
: isServer
? ['src/server/**/*.test.ts', 'src/test/e2e/**/*.test.ts', 'src/test/unit/**/*.test.ts']
: ['src/**/*.test.ts'];
const coverageInclude = isClient
? ['src/client/**/*.ts']
: isServer
? ['src/server/**/*.ts']
: ['src/**/*.ts'];
const coverageDir = isClient
? './coverage/client'
: isServer
? './coverage/server'
: './coverage';
// No thresholds - we just want to report coverage without failing builds
return {
test: {
globals: true,
include: testInclude,
setupFiles: ['./src/test/setup.ts'],
environment: isClient ? 'happy-dom' : 'node',
testTimeout: 60000, // 60s for e2e tests
hookTimeout: 30000, // 30s for setup/teardown
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'json-summary', 'html', 'lcov'],
exclude: [
'node_modules/',
'src/test/',
'dist/',
'public/',
'*.config.ts',
'*.config.js',
'**/*.test.ts',
'**/*.spec.ts',
],
include: coverageInclude,
all: true,
reportsDirectory: coverageDir,
// No thresholds - just report coverage
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
};
});