-
Notifications
You must be signed in to change notification settings - Fork 857
/
Copy pathvitest.config.ts
39 lines (37 loc) · 1.11 KB
/
vitest.config.ts
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
import { defineWorkersProject } from "@cloudflare/vitest-pool-workers/config";
export default defineWorkersProject({
test: {
globalSetup: ["./global-setup.ts"],
poolOptions: {
workers: {
singleWorker: true,
miniflare: {
// Configuration for the test runner Worker
compatibilityDate: "2024-01-01",
compatibilityFlags: [
"nodejs_compat",
// Required to use `WORKER.scheduled()`. This is an experimental
// compatibility flag, and cannot be enabled in production.
"service_binding_extra_handlers",
],
serviceBindings: {
WORKER: "worker-under-test",
},
workers: [
// Configuration for the "auxiliary" Worker under test.
// Unfortunately, auxiliary Workers cannot load their configuration
// from `wrangler.toml` files, and must be configured with Miniflare
// `WorkerOptions`.
{
name: "worker-under-test",
modules: true,
scriptPath: "./dist/index.js", // Built by `global-setup.ts`
compatibilityDate: "2024-01-01",
compatibilityFlags: ["nodejs_compat"],
},
],
},
},
},
},
});