-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathvitest.config.ts
More file actions
82 lines (81 loc) · 2.03 KB
/
vitest.config.ts
File metadata and controls
82 lines (81 loc) · 2.03 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import { defineVitestProject } from '@nuxt/test-utils/config'
import { defineConfig, defineProject } from 'vitest/config'
export default defineConfig({
test: {
globals: true,
reporters: 'dot',
projects: [
// type tests using vitest typecheck
defineProject({
test: {
name: 'typecheck',
include: [
'./test/types/**/*.test-d.ts',
],
typecheck: {
enabled: true,
include: ['./test/types/**/*.test-d.ts'],
},
},
}),
// utils folders as *.test.ts in either test/unit or in src/**/*.test.ts
defineProject({
test: {
name: 'unit',
environment: 'node',
include: [
'./**/*.test.ts',
],
exclude: [
'./test/e2e/**/*.test.ts',
'./test/e2e-dev/**/*.test.ts',
'**/*.nuxt.test.ts',
'**/node_modules/**',
],
},
}),
// e2e tests in test/e2e
defineProject({
test: {
name: 'e2e',
include: [
'./test/e2e/**/*.test.ts',
],
exclude: [
'**/node_modules/**',
],
},
}),
// nuxt tests in tests/nuxt-runtime OR *.nuxt.test.ts
defineVitestProject({
test: {
name: 'nuxt-runtime',
environment: 'nuxt',
include: [
'./tests/nuxt-runtime/**/*.test.ts',
'./**/*.nuxt.test.ts',
],
exclude: [
// exclude other tests
'./test/e2e/**/*.test.ts',
'./test/e2e-dev/**/*.test.ts',
'./test/unit/**/*.test.ts',
'**/node_modules/**',
],
},
}),
// e2e-dev: local-only e2e tests (excluded from CI)
defineProject({
test: {
name: 'e2e-dev',
include: [
'./test/e2e-dev/**/*.test.ts',
],
exclude: [
'**/node_modules/**',
],
},
}),
],
},
})