-
-
Notifications
You must be signed in to change notification settings - Fork 424
Expand file tree
/
Copy pathvitest.config.ts
More file actions
71 lines (69 loc) · 2.03 KB
/
vitest.config.ts
File metadata and controls
71 lines (69 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
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import { defineVitestProject } from '@nuxt/test-utils/config'
import { playwright } from '@vitest/browser-playwright'
const rootDir = fileURLToPath(new URL('.', import.meta.url))
export default defineConfig({
test: {
projects: [
{
resolve: {
alias: {
'#shared': `${rootDir}/shared`,
},
},
test: {
name: 'unit',
include: ['test/unit/*.{test,spec}.ts'],
environment: 'node',
},
},
await defineVitestProject({
test: {
name: 'nuxt',
include: ['test/nuxt/**/*.{test,spec}.ts'],
environment: 'nuxt',
setupFiles: ['./test/nuxt/setup.ts'],
environmentOptions: {
nuxt: {
rootDir: fileURLToPath(new URL('.', import.meta.url)),
overrides: {
experimental: {
viteEnvironmentApi: false,
},
ogImage: { enabled: false },
},
},
},
browser: {
enabled: true,
provider: playwright(),
instances: [{ browser: 'chromium' }],
},
},
}),
],
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',
],
},
},
})