-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
63 lines (62 loc) · 1.6 KB
/
vitest.config.ts
File metadata and controls
63 lines (62 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
54
55
56
57
58
59
60
61
62
63
import path from 'path';
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
globals: true,
environment: 'node',
setupFiles: ['./tests/vitest-setup.ts', './tests/setup.ts'],
// Run tests sequentially to avoid database deadlocks
pool: 'forks',
poolOptions: {
forks: {
singleFork: true,
},
},
// Reduce log verbosity for cleaner aggregate test output
silent: true,
// reporters: ['basic'],
env: {
DATABASE_URL:
'postgresql://postgres:postgres@localhost:5556/postgres_test',
NODE_ENV: 'test',
ELIZA_AGENT_SECRET: 'test-eliza-secret',
MCP_SERVICE_SECRET: 'test-mcp-secret',
NEYNAR_API_KEY: 'test-neynar-key',
XMTP_ENV: 'dev', // Required for XMTP route imports
},
// Allow inlining of XMTP SDK for proper mocking in ESM
server: {
deps: {
inline: ['@xmtp/node-sdk'],
},
},
// Mock configuration
alias: {
'@/utils/xmtp-client-manager': new URL(
'./tests/__mocks__/xmtp-client-manager.ts',
import.meta.url
).pathname,
},
coverage: {
provider: 'istanbul',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/',
'tests/',
'dist/',
'**/*.d.ts',
'src/db/migrations/',
'src/index.ts', // Main entry point - not typically unit tested
'**/*.config.ts',
'**/*.config.js',
'src/utils/logger.ts',
'src/routes/health.ts',
],
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
});