-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathvitest.config.ts
More file actions
50 lines (48 loc) · 1.26 KB
/
vitest.config.ts
File metadata and controls
50 lines (48 loc) · 1.26 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
import { defineWorkersConfig } from '@cloudflare/vitest-pool-workers/config';
const runIntegrationTests = process.env.VIBESDK_RUN_INTEGRATION_TESTS === '1';
export default defineWorkersConfig({
resolve: {
alias: {
'bun:test': 'vitest',
},
},
test: {
globals: true,
pool: '@cloudflare/vitest-pool-workers',
deps: {
optimizer: {
ssr: {
enabled: true,
include: [
'@cloudflare/containers',
'@cloudflare/sandbox',
'@babel/traverse',
'@babel/types',
],
},
},
},
poolOptions: {
workers: {
main: './test/worker-entry.ts',
wrangler: { configPath: './wrangler.test.jsonc' },
miniflare: {
compatibilityDate: '2024-12-12',
compatibilityFlags: ['nodejs_compat'],
},
},
},
include: ['**/*.{test,spec}.{js,ts,jsx,tsx}'],
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/.git/**',
'**/worker/api/routes/**',
'**/test/worker-entry.ts',
'**/container/monitor-cli.test.ts',
'**/cf-git/**',
'**/sdk/test/**', // SDK tests run with bun test, not vitest
...(runIntegrationTests ? [] : ['**/sdk/test/integration/**']),
],
},
});