-
-
Notifications
You must be signed in to change notification settings - Fork 325
Expand file tree
/
Copy pathvitest.config.ts
More file actions
83 lines (81 loc) · 2.48 KB
/
vitest.config.ts
File metadata and controls
83 lines (81 loc) · 2.48 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
83
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vite-plus'
import { defineVitestProject } from '@nuxt/test-utils/config'
import { playwright } from 'vite-plus/test/browser-playwright'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
export default defineConfig({
test: {
projects: [
{
resolve: {
alias: {
'#shared': `${rootDir}/shared`,
'#server': `${rootDir}/server`,
},
},
test: {
name: 'unit',
include: ['test/unit/**/*.{test,spec}.ts'],
environment: 'node',
},
},
await defineVitestProject({
test: {
name: 'nuxt',
include: ['test/nuxt/**/*.{test,spec}.ts'],
environment: 'nuxt',
environmentOptions: {
nuxt: {
rootDir: fileURLToPath(new URL('.', import.meta.url)),
overrides: {
vue: {
runtimeCompiler: true,
},
experimental: {
payloadExtraction: false,
viteEnvironmentApi: false,
},
pwa: {
pwaAssets: { disabled: true },
},
ogImage: { enabled: false },
unocss: {
// app.vue (which imports 'uno.css') is stubbed out by
// @nuxt/test-utils, leaving utility classes missing.
autoImport: true,
},
},
},
},
browser: {
enabled: true,
provider: playwright(),
instances: [{ browser: 'chromium', headless: true }],
},
},
}),
],
coverage: {
enabled: true,
provider: 'v8',
// Exclude files that cause parse errors during coverage remapping.
// The V8 coverage provider uses rolldown to parse source files, but
// rolldown seems to currently fail on Vite's SSR transform output (`await __vite_ssr_import__`).
exclude: [
'**/node_modules/**',
'cli/**',
'app/utils/versions.ts',
'app/utils/package-name.ts',
'shared/utils/git-providers.ts',
'shared/utils/spdx.ts',
'shared/utils/url.ts',
'server/utils/readme.ts',
'server/utils/docs/text.ts',
'server/utils/code-highlight.ts',
'server/utils/npm.ts',
'server/utils/shiki.ts',
'server/utils/jsr.ts',
],
},
},
})