-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
100 lines (97 loc) · 3.61 KB
/
Copy pathvitest.config.ts
File metadata and controls
100 lines (97 loc) · 3.61 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
import { mergeConfig } from 'vite';
import { defineConfig } from 'vitest/config';
import viteConfig from './vite.config.ts';
const COVERAGE_MINIMUM = 46;
export default mergeConfig(
viteConfig,
defineConfig({
resolve: process.env.VITEST ? { conditions: ['browser'] } : undefined,
test: {
alias: {
'$app/paths/internal/client': new URL(
'./node_modules/@sveltejs/kit/src/runtime/app/paths/internal/client.js',
import.meta.url
).pathname,
'$app/paths': new URL(
'./node_modules/@sveltejs/kit/src/runtime/app/paths/client.js',
import.meta.url
).pathname,
},
projects: [
{
extends: true,
test: {
name: 'node',
environment: 'node',
include: ['src/**/*.test.ts'],
exclude: [
'src/lib/features/composer/VoiceRecorder.svelte.test.ts',
'src/lib/features/composer/voice-recorder-encoder.test.ts',
'src/lib/features/room/timeline/TimelineReadReceipt.svelte.test.ts',
'src/lib/ui/long-press.svelte.test.ts',
'src/lib/features/room/messages/message-swipe.svelte.test.ts',
'src/lib/core/attachment-info.test.ts',
'src/lib/ui/shortcuts/binding.test.ts',
'src/lib/ui/shortcuts/global-shortcuts.test.ts',
'src/lib/ui/swipe-gesture.test.ts',
'src/lib/ui/swipe-back.svelte.test.ts',
'src/lib/ui/double-tap.test.ts',
'src/lib/ui/trailing-click.test.ts',
'src/lib/ui/video-support.test.ts',
'src/lib/platform/devtools.test.ts',
'src/lib/platform/keyboard.test.ts',
'src/lib/settings/theme-styles.test.ts',
'src/lib/features/room/messages/reply-preview.test.ts',
],
},
},
{
extends: true,
test: {
name: 'happy-dom',
environment: 'happy-dom',
include: [
'src/lib/features/composer/VoiceRecorder.svelte.test.ts',
'src/lib/features/composer/voice-recorder-encoder.test.ts',
'src/lib/features/room/timeline/TimelineReadReceipt.svelte.test.ts',
'src/lib/ui/long-press.svelte.test.ts',
'src/lib/features/room/messages/message-swipe.svelte.test.ts',
'src/lib/core/attachment-info.test.ts',
'src/lib/ui/shortcuts/binding.test.ts',
'src/lib/ui/shortcuts/global-shortcuts.test.ts',
'src/lib/ui/swipe-gesture.test.ts',
'src/lib/ui/swipe-back.svelte.test.ts',
'src/lib/ui/double-tap.test.ts',
'src/lib/ui/trailing-click.test.ts',
'src/lib/ui/video-support.test.ts',
'src/lib/platform/devtools.test.ts',
'src/lib/platform/keyboard.test.ts',
'src/lib/settings/theme-styles.test.ts',
'src/lib/features/room/messages/reply-preview.test.ts',
],
},
},
],
setupFiles: ['./vitest-setup.ts'],
coverage: {
provider: 'v8',
reporter: ['text', 'html', 'lcov'],
include: ['src/**/*.{ts,svelte}'],
exclude: [
'src/**/*.d.ts',
'src/**/*.test.ts',
'src/**/__mocks__/**',
'src/lib/test-support/**',
'src/app.d.ts',
'src/generated/**',
],
thresholds: {
lines: COVERAGE_MINIMUM,
functions: COVERAGE_MINIMUM,
branches: COVERAGE_MINIMUM,
statements: COVERAGE_MINIMUM,
},
},
},
})
);