forked from Cap-go/capgo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.cloudflare.ts
More file actions
33 lines (32 loc) · 1.11 KB
/
vitest.config.cloudflare.ts
File metadata and controls
33 lines (32 loc) · 1.11 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
import path from 'node:path'
import { cwd } from 'node:process'
import { loadEnv } from 'vite'
import { defineConfig } from 'vitest/config'
export default defineConfig(({ mode }) => ({
resolve: {
alias: {
'@capgo/cli/sdk': path.resolve(cwd(), 'cli/src/sdk.ts'),
'~/': `${path.resolve(cwd(), 'src')}/`,
},
},
test: {
include: ['tests/*.test.ts'],
environment: 'node',
watch: false,
bail: 0, // Run all tests to see full results
testTimeout: 30_000, // Increased timeout for Cloudflare Workers
hookTimeout: 15_000, // Match the main config for slower CI setup hooks
retry: 2,
maxConcurrency: 10, // Reduced for replica sync reliability
maxWorkers: 5, // Reduced for replica sync reliability
env: {
...loadEnv(mode, cwd(), ''),
// Override to use Cloudflare Workers instead of Supabase Edge Functions
USE_CLOUDFLARE_WORKERS: 'true',
// Cloudflare Workers run on different ports
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',
},
},
}))