-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathvitest.config.ts
More file actions
68 lines (66 loc) · 1.55 KB
/
vitest.config.ts
File metadata and controls
68 lines (66 loc) · 1.55 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
import { defineConfig } from 'vitest/config'
export default defineConfig({
esbuild: {
tsconfigRaw: {
compilerOptions: {
// Enable decorators, workaround for https://github.com/unjs/nitro/issues/1380
experimentalDecorators: true,
},
},
},
resolve: {
// Workaround for https://github.com/nuxt/test-utils/issues/1408
alias: {
'~/': new URL(`./`, import.meta.url).pathname,
'#graphql/schema': new URL(`.nuxt/graphql-schema.mjs`, import.meta.url)
.pathname,
},
},
test: {
// Run before each test file
// https://vitest.dev/config/#setupfiles
setupFiles: ['test/global.setup.ts'],
// Code coverage
// https://vitest.dev/config/#coverage and https://vitest.dev/guide/coverage.html
coverage: {
reporter: ['json', 'text'],
},
projects: [
{
extends: true,
test: {
name: 'unit',
isolate: false,
sequence: {
groupOrder: 0,
},
include: ['**/**spec.ts'],
},
},
{
extends: true,
test: {
name: 'integration',
include: ['**/**integration.test.ts'],
maxWorkers: 1,
sequence: {
groupOrder: 1,
},
},
},
{
extends: true,
test: {
name: 'e2e',
isolate: false,
include: ['**/**e2e.test.ts'],
maxWorkers: 1,
hookTimeout: 400000,
sequence: {
groupOrder: 2,
},
},
},
],
},
})