-
-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathvitest.config.cloudflare-plugin.ts
More file actions
31 lines (30 loc) · 901 Bytes
/
vitest.config.cloudflare-plugin.ts
File metadata and controls
31 lines (30 loc) · 901 Bytes
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
import path from 'node:path'
import { cwd, env } from 'node:process'
import { loadEnv } from 'vite'
import { defineConfig } from 'vitest/config'
export default defineConfig(({ mode }) => ({
resolve: {
alias: {
'~/': `${path.resolve(cwd(), 'src')}/`,
},
},
test: {
include: ['tests/*.test.ts'],
environment: 'node',
watch: false,
bail: 0,
testTimeout: env.CI ? 60_000 : 30_000, // 60s in CI, 30s locally
hookTimeout: 10_000,
retry: 2,
// Very low concurrency for plugin tests that hit shared replica state
maxConcurrency: 1, // Run tests sequentially
maxWorkers: 1, // Single worker
env: {
...loadEnv(mode, cwd(), ''),
USE_CLOUDFLARE_WORKERS: 'true',
CLOUDFLARE_API_URL: 'http://127.0.0.1:8787',
CLOUDFLARE_PLUGIN_URL: 'http://127.0.0.1:8788',
CLOUDFLARE_FILES_URL: 'http://127.0.0.1:8789',
},
},
}))