-
Notifications
You must be signed in to change notification settings - Fork 266
Expand file tree
/
Copy pathvitest.workerd.config.ts
More file actions
33 lines (31 loc) · 1.16 KB
/
Copy pathvitest.workerd.config.ts
File metadata and controls
33 lines (31 loc) · 1.16 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 {cloudflareTest} from '@cloudflare/vitest-pool-workers'
import {defineConfig} from 'vitest/config'
import {TEST_PORT} from './test/helpers/routes.ts'
import {sharedConfig, standaloneServer} from './vitest.config.ts'
/**
* Runs the suite on workerd, the runtime behind Cloudflare Workers, through miniflare. Unlike
* the browser suites this is a server-side environment, so it neither enforces CORS nor keeps a
* cookie jar - it should behave like node.
*
* `nodejs_compat` is deliberately not enabled: the client has to work on bare workerd, and the
* flag would let the resolver match the `node` export condition. `compatibilityDate` is
* required, as workerd refuses to start without one.
*
* The one behaviour it does not match the other runtimes on is `on*` handler dispatch;
* `test/client.test.ts` marks the seven tests that depend on it as known failures.
*/
export default defineConfig({
plugins: [
cloudflareTest({
miniflare: {
compatibilityDate: '2026-06-01',
compatibilityFlags: [],
},
}),
],
test: {
...sharedConfig,
globalSetup: standaloneServer,
provide: {port: TEST_PORT, suite: 'workerd'},
},
})