-
-
Notifications
You must be signed in to change notification settings - Fork 125
Expand file tree
/
Copy pathvitest.config.ts
More file actions
103 lines (100 loc) · 2.79 KB
/
vitest.config.ts
File metadata and controls
103 lines (100 loc) · 2.79 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import {svelte} from '@sveltejs/vite-plugin-svelte';
import {svelteTesting} from '@testing-library/svelte/vite';
import {tmpdir} from 'os';
import {resolve} from 'path';
import {coverageConfigDefaults, defineConfig} from 'vitest/config';
export default defineConfig({
test: {
environment: 'happy-dom',
execArgv: [
'--localstorage-file',
resolve(tmpdir(), `vitest-${process.pid}.localstorage`),
],
setupFiles: ['test/vitest/setup.ts'],
reporters: [['test/vitest/reporter.ts', {hideSkipped: true}]],
slowTestThreshold: 3000,
maxWorkers: 8,
passWithNoTests: true,
testTimeout: 20000,
retry: 10,
coverage: {
enabled: false,
provider: 'istanbul',
exclude: coverageConfigDefaults.exclude.filter((e) => e !== 'dist/**'),
include: [
'dist/index.js',
'dist/ui-react/index.js',
'dist/ui-svelte/index.js',
],
reportsDirectory: './tmp/coverage',
reporter: ['text-summary', 'json-summary', 'html'],
},
onUnhandledError: ({message}) =>
message !== 'Invariant: worker WS endpoint not found',
projects: [
{
extends: true,
test: {
name: 'unit',
include: ['test/unit/**/*.test.ts', 'test/unit/**/*.test.tsx'],
exclude: [
'test/unit/core/ui-svelte/**',
'test/unit/synchronizers/synchronizer-ws-server.test.ts',
'test/unit/core/types/types.test.tsx',
'test/unit/documentation.test.ts',
'test/unit/persisters/**/*.test.ts',
],
},
},
{
extends: true,
test: {
name: 'unit-ws-server',
include: ['test/unit/synchronizers/synchronizer-ws-server.test.ts'],
sequence: {groupOrder: 1},
},
},
{
extends: true,
test: {
name: 'unit-types',
include: ['test/unit/core/types/types.test.tsx'],
sequence: {groupOrder: 2},
},
},
{
extends: true,
test: {
name: 'unit-documentation',
include: ['test/unit/documentation.test.ts'],
sequence: {groupOrder: 3},
},
},
{
extends: true,
test: {
name: 'unit-persisters',
include: ['test/unit/persisters/**/*.test.ts'],
sequence: {groupOrder: 4},
maxWorkers: 2,
},
},
{
extends: true,
plugins: [svelte(), svelteTesting()],
test: {
name: 'svelte',
include: ['test/unit/core/ui-svelte/**/*.test.ts'],
},
},
{
extends: true,
test: {name: 'perf', include: ['test/perf/**/*.test.ts']},
},
{
extends: true,
test: {name: 'prod', include: ['test/prod/**/*.test.ts']},
},
],
},
});