-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
42 lines (40 loc) · 1.34 KB
/
vitest.config.ts
File metadata and controls
42 lines (40 loc) · 1.34 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
import {
cloudflareTest,
readD1Migrations,
} from "@cloudflare/vitest-pool-workers";
import { defineConfig } from "vitest/config";
const migrations = await readD1Migrations("./migrations");
export default defineConfig({
plugins: [
cloudflareTest({
main: "./test/worker-test-entry.ts",
wrangler: { configPath: "./wrangler.jsonc" },
// Disable remote bindings — tests mock all external services (AI,
// fetch, etc.) so the pool doesn't need to dial Cloudflare's edge.
remoteBindings: false,
miniflare: {
bindings: {
TEST_MIGRATIONS: migrations,
JWT_SECRET: "test-jwt-secret-at-least-32-characters-long-for-hs256",
GITHUB_WEBHOOK_SECRET: "test-webhook-secret-at-least-32-characters",
GITHUB_APP_PRIVATE_KEY: "test-placeholder",
GITHUB_APP_ID: "12345",
UNOSEND_API_KEY: "un_test_api_key_for_vitest",
UNOSEND_WEBHOOK_SECRET:
"test-unosend-webhook-secret-at-least-32-chars",
},
},
}),
],
test: {
setupFiles: ["./test/setup.ts"],
// Exclude nested git worktrees (`.claude/worktrees/*`) and the
// standard noisy paths so vitest only picks up THIS worktree's tests.
exclude: [
"**/node_modules/**",
"**/dist/**",
"**/.{idea,git,cache,output,temp}/**",
".claude/**",
],
},
});