forked from useplunk/plunk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
53 lines (52 loc) · 1.6 KB
/
Copy pathvitest.config.ts
File metadata and controls
53 lines (52 loc) · 1.6 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
import {defineConfig} from 'vitest/config';
import path from 'path';
export default defineConfig({
test: {
globals: true,
environment: 'node',
setupFiles: ['./test/setup.ts'],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/',
'dist/',
'.next/',
'**/*.config.ts',
'**/*.config.js',
'test/',
'**/*.test.ts',
'**/*.spec.ts',
],
},
testTimeout: 30000,
hookTimeout: 30000,
// Memory optimization: Run tests in sequence to prevent memory issues
// This is critical for tests that create large datasets
pool: 'forks',
poolOptions: {
forks: {
singleFork: true, // Run all tests in a single fork to limit memory
},
},
// Run tests sequentially to avoid database cleanup conflicts
fileParallelism: false,
// Limit concurrent test files to reduce memory pressure
maxConcurrency: 3,
// Only include our test files, not dependency tests
include: [
'apps/**/__tests__/**/*.{test,spec}.{ts,tsx}',
'packages/**/__tests__/**/*.{test,spec}.{ts,tsx}',
'test/**/*.{test,spec}.{ts,tsx}',
],
exclude: ['node_modules/**', '**/node_modules/**', 'dist/**', '.next/**', '.turbo/**'],
},
resolve: {
alias: {
'@plunk/db': path.resolve(__dirname, './packages/db/src'),
'@plunk/shared': path.resolve(__dirname, './packages/shared/src'),
'@plunk/types': path.resolve(__dirname, './packages/types/src'),
'@plunk/email': path.resolve(__dirname, './packages/email/src'),
},
},
});