-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathvitest.config.mts
More file actions
46 lines (44 loc) · 1.65 KB
/
vitest.config.mts
File metadata and controls
46 lines (44 loc) · 1.65 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
import { loadEnv } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import { defineConfig } from 'vitest/config';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
define: {
'process.env.ETHEREUM_RPC_URL': JSON.stringify(
env.ETHEREUM_RPC_URL,
),
'process.env.POLYGON_RPC_URL': JSON.stringify(env.POLYGON_RPC_URL),
'process.env.ARBITRUM_RPC_URL': JSON.stringify(
env.ARBITRUM_RPC_URL,
),
'process.env.FANTOM_RPC_URL': JSON.stringify(env.FANTOM_RPC_URL),
'process.env.OPTIMISM_RPC_URL': JSON.stringify(
env.OPTIMISM_RPC_URL,
),
'process.env.SKIP_GLOBAL_SETUP': JSON.stringify(
env.SKIP_GLOBAL_SETUP,
),
},
test: {
testTimeout: 20_000,
hookTimeout: 60_000,
setupFiles: ['/test/vitest-setup.ts'],
globals: true,
pool: 'forks',
// Limit concurrent forks to avoid overwhelming RPC providers with too many connections
// Each fork creates its own Anvil instance which makes RPC calls
poolOptions: {
forks: {
maxForks: 3,
minForks: 1,
},
},
// Uncomment to debug suite excluding some tests
// exclude: ['test/*weighted*.integration.*', 'node_modules', 'dist'],
// Uncomment to run integration tests sequentially
// threads: false,
},
plugins: [tsconfigPaths()],
};
});