-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathvitest.config.js
More file actions
34 lines (33 loc) · 1.04 KB
/
Copy pathvitest.config.js
File metadata and controls
34 lines (33 loc) · 1.04 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
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
// Two environments, because the two kinds of JS in this repo don't run in the same place.
// The frontend needs jsdom and the browser mocks in test/setup.js; the Cloudflare Workers
// need node, whose Request/Response behave like workerd's — jsdom's Request silently drops
// the method and headers of a Request passed as init, which the Workers rely on.
projects: [
{
test: {
name: 'frontend',
environment: 'jsdom',
globals: true,
include: ['app/frontend/**/*.test.js'],
setupFiles: ['app/frontend/test/setup.js']
}
},
{
test: {
name: 'workers',
environment: 'node',
globals: true,
include: ['cloudflare/**/*.test.js']
}
}
],
coverage: {
provider: 'v8',
include: ['app/frontend/controllers/**/*.js', 'app/frontend/lib/**/*.js'],
exclude: ['app/frontend/packs/**/*.js']
}
}
});