-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
25 lines (24 loc) · 859 Bytes
/
Copy pathvitest.config.ts
File metadata and controls
25 lines (24 loc) · 859 Bytes
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
import { defineConfig } from 'vitest/config';
export default defineConfig({
resolve: {
alias: {
// `cloudflare:email` is a virtual module only resolvable in the
// Workers runtime; unit tests run in Node, so it's aliased to a
// minimal shim. See tests/shims/cloudflare-email.ts.
'cloudflare:email': new URL('./tests/shims/cloudflare-email.ts', import.meta.url).pathname,
// `cloudflare:workers` (the `env` export) is likewise only resolvable
// in the Workers runtime. See tests/shims/cloudflare-workers.ts.
'cloudflare:workers': new URL('./tests/shims/cloudflare-workers.ts', import.meta.url)
.pathname,
},
},
test: {
globals: true,
environment: 'node',
include: ['tests/unit/**/*.test.ts'],
coverage: {
provider: 'v8',
reporter: ['text', 'html'],
},
},
});