import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
// Test environment
environment: 'node',
// Include patterns
include: ['tests/**/*.test.ts'],
// Exclude patterns
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/.{idea,git,cache,output,temp}/**',
],
// Coverage configuration
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html', 'lcov'],
reportsDirectory: './coverage',
// Coverage thresholds (80% target)
thresholds: {
lines: 80,
functions: 80,
branches: 80,
statements: 80,
},
// Include only source files
include: ['src/**/*.ts'],
// Exclude from coverage
exclude: [
'src/index.ts', // MCP server entry point (integration test)
'src/types/**', // Type definitions
'**/*.d.ts', // Declaration files
'**/*.test.ts', // Test files
'**/node_modules/**',
],
},
// Global test timeout (5s for unit tests)
testTimeout: 5000,
// Separate timeouts for different test types
hookTimeout: 10000,
// Allow parallel test execution
pool: 'threads',
poolOptions: {
threads: {
singleThread: false,
},
},
// Globals
globals: true,
},
});