-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathvitest.config.ts
More file actions
101 lines (99 loc) · 3.53 KB
/
vitest.config.ts
File metadata and controls
101 lines (99 loc) · 3.53 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
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import { fileURLToPath } from 'url';
import { dirname, resolve } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
export default defineConfig({
plugins: [react()],
test: {
globals: true,
watch: false,
testTimeout: 5000, // 5 second timeout per test
hookTimeout: 5000, // 5 second timeout for hooks
pool: 'forks', // Use forks to avoid SIGABRT crash during cleanup
poolOptions: {
forks: {
singleFork: false,
isolate: true,
},
},
teardownTimeout: 5000,
passWithNoTests: true,
// Use workspace for environment-specific configuration
workspace: [
{
extends: true,
test: {
name: 'node',
environment: 'node',
include: ['src/**/*.test.ts', 'tests/**/*.test.ts', 'workers/**/*.test.ts'],
exclude: ['src/**/hooks/*.test.ts'],
},
},
{
extends: true,
test: {
name: 'jsdom',
environment: 'jsdom',
include: ['src/**/*.test.tsx', 'src/**/hooks/*.test.ts'],
},
},
],
exclude: [
'node_modules',
'.next',
'dist',
// Exclude large test files (500+ lines) that cause memory issues and slow down CI
'src/lib/streaming/streaming.test.ts', // 3094 lines
'src/lib/torrent/torrent.test.ts', // 1221 lines
'src/lib/metadata-enrichment/metadata-enrichment.test.ts', // 956 lines
'src/components/media/media-player-modal.test.tsx', // 828 lines
'src/lib/transcoding/transcoding.test.ts', // 795 lines
'src/lib/iptv/iptv.test.ts', // 649 lines
'src/app/account/page.test.tsx', // 620 lines
'src/lib/payments/repository.test.ts', // 612 lines
'src/app/api/search/route.test.ts', // 598 lines
'src/lib/subscription/repository.test.ts', // 594 lines
'src/components/torrent-catalog/torrent-catalog.test.tsx', // 590 lines
'src/lib/supabase/queries.test.ts', // 566 lines
'src/lib/coinpayportal/webhook-handler.test.ts', // 564 lines
'src/lib/watch-party/watch-party.test.ts', // 558 lines
'src/lib/torrent-deletion/torrent-deletion.test.ts', // 553 lines
'src/lib/podcasts/repository.test.ts', // 552 lines
'src/lib/progress/progress.test.ts', // 539 lines
'src/lib/xtream/xtream.test.ts', // 536 lines
'src/lib/argontv/repository.test.ts', // 536 lines
// Tests that fail in CI due to browser API mocking issues (HLS.js, mpegts.js)
'src/components/live-tv/hls-player-modal.test.tsx',
'src/components/media/playlist-player-modal.test.tsx',
// WebTorrent-related tests - excluded to avoid native dependency issues in CI
'src/hooks/use-webtorrent.test.ts', // 690 lines, WebTorrent hook tests
'src/lib/webtorrent-loader/webtorrent-loader.test.ts', // WebTorrent loader tests
],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/',
'.next/',
'dist/',
'**/*.d.ts',
'**/*.config.*',
'**/types/**',
],
thresholds: {
statements: 80,
branches: 80,
functions: 80,
lines: 80,
},
},
setupFiles: ['./vitest.setup.ts'],
},
resolve: {
alias: {
'@': resolve(__dirname, './src'),
},
},
});