-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
36 lines (35 loc) · 1.52 KB
/
Copy pathvitest.config.ts
File metadata and controls
36 lines (35 loc) · 1.52 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
import { cloudflareTest } from "@cloudflare/vitest-pool-workers"
import { defineConfig } from "vitest/config"
// Tests run inside workerd (via miniflare) so Durable Objects behave like
// production. Pure-TS units (e.g. the wire codec) run here too — workerd is a
// V8 isolate, so they execute identically and we keep a single runner.
export default defineConfig({
plugins: [
cloudflareTest({
singleWorker: true,
// WebSocket integration tests keep durable connections open across the
// suite, which is incompatible with isolated-storage stacking. Tests
// use unique DO names (random UUIDs / distinct rooms) for isolation
// instead, so per-test storage rollback is unnecessary.
isolatedStorage: false,
main: "./tests/test-worker.ts",
miniflare: {
compatibilityDate: "2026-03-10",
compatibilityFlags: ["nodejs_compat"],
durableObjects: {
TEST_DO: { className: "TestDO", useSQLite: true },
SYNC_DO: { className: "SyncTestDO", useSQLite: true },
UNREG_DO: { className: "UnregisteredDO", useSQLite: true },
MAINT_DO: { className: "MaintTestDO", useSQLite: true },
SLOW_DO: { className: "SlowTickDO", useSQLite: true },
LIMITS_DO: { className: "LimitsTestDO", useSQLite: true },
HOST_DO: { className: "SyncOverHostDO", useSQLite: true },
HOST_OPTIN_DO: { className: "SyncOverHostOptInDO", useSQLite: true },
},
},
}),
],
test: {
include: ["tests/**/*.test.ts"],
},
})