-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathvitest.config.simple.ts
More file actions
103 lines (91 loc) · 3.44 KB
/
vitest.config.simple.ts
File metadata and controls
103 lines (91 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
/**
* Bulletproof Test Configuration
*
* This configuration strictly follows the bulletproof testing guidelines:
* - NO async/await patterns
* - NO complex mocking
* - NO integration tests
* - Maximum 5 second timeout per test
* - Complete isolation between tests
*
* See: docs/testing/BULLETPROOF_TESTING_GUIDELINES.md
*/
export default defineConfig({
plugins: [react()],
test: {
environment: 'jsdom',
globals: true,
// Strict timeouts per bulletproof guidelines
testTimeout: 5000, // 5 seconds max per test
hookTimeout: 2000, // 2 seconds for setup/teardown
teardownTimeout: 1000,
// Complete isolation - no shared state
isolate: true,
fileParallelism: false,
// Single thread for absolute stability
pool: 'forks',
poolOptions: {
forks: {
singleFork: true,
isolate: true,
},
},
// Minimal setup - just DOM cleanup
setupFiles: ['./src/__mocks__/no-mocks-setup.ts'],
// Include all tests except known problematic ones
include: ['src/**/*.test.ts', 'src/**/*.test.tsx'],
// Exclude tests with forbidden patterns
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/coverage/**',
// Tests with async/await patterns (forbidden)
'src/__tests__/github-auth-hook.test.tsx',
'src/app/services/__tests__/issue-similarity.test.ts',
'src/app/webhooks/__tests__/issue-comment.test.ts',
'src/components/__tests__/login-required-for-search.test.tsx',
'src/components/features/repository/__tests__/repository-summary-card.test.tsx',
'src/evals/__tests__/evaluation-framework.test.ts',
'src/hooks/__tests__/use-github-api.test.ts',
'src/hooks/__tests__/use-repo-data.test.ts',
'src/hooks/__tests__/use-repo-search.test.ts',
'src/hooks/__tests__/use-repository-discovery.test.ts',
'src/hooks/__tests__/use-repository-summary.test.ts',
// Tests with complex timing/promise patterns (forbidden)
'src/hooks/__tests__/use-progressive-repo-data.test.ts',
'src/hooks/__tests__/use-intersection-loader.test.ts',
'src/hooks/__tests__/progressive-loading-integration.test.tsx',
'src/hooks/__tests__/progressive-loading-error-boundary.test.tsx',
'src/lib/__tests__/link-capturing.test.ts',
'src/lib/__tests__/yolo-behavior.test.ts',
'src/lib/inngest/functions/__tests__/event-flow.integration.test.ts',
'src/lib/insights/health-metrics.test.ts',
'src/lib/progressive-capture/__tests__/hybrid-queue-manager.test.ts',
// Tests with async patterns added in fix/repository-status-json-response PR
// These have been rewritten to follow bulletproof guidelines
// 'src/hooks/__tests__/useWorkspacePRs.test.ts', // Fixed - now synchronous
// 'src/lib/insights/issue-metrics.test.ts', // Fixed - now synchronous
// 'src/lib/spam/__tests__/SpamDetectionService.test.ts', // Fixed - now synchronous
],
// No coverage - focus on stability
coverage: {
enabled: false,
},
// Simple reporter for CI
reporters: process.env.CI ? ['default'] : ['default', 'html'],
// Fail fast in CI
bail: process.env.CI ? 1 : 0,
// No threads for maximum stability
threads: false,
maxWorkers: 1,
minWorkers: 1,
},
resolve: {
alias: {
'@': resolve(__dirname, './src'),
},
},
});