-
-
Notifications
You must be signed in to change notification settings - Fork 207
Expand file tree
/
Copy pathvitest.config.ts
More file actions
42 lines (41 loc) · 1.12 KB
/
vitest.config.ts
File metadata and controls
42 lines (41 loc) · 1.12 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
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vitest/config';
export default defineConfig({
plugins: [sveltekit()],
test: {
include: ['tests/unit/**/*.{test,spec}.{js,ts}'],
exclude: ['tests/e2e/**/*'],
environment: 'jsdom',
setupFiles: ['./tests/setup.ts'],
globals: true,
hideSkippedTests: true,
onConsoleLog: (log, type) => {
// Suppress expected error patterns from appearing in test output
if (type === 'stderr' && log.includes('error:')) {
return false; // Don't print this log
}
return undefined; // Use default behavior for other logs
},
coverage: {
include: ['src/**/*.{js,ts}'],
exclude: [
'src/**/*.{test,spec}.{js,ts}',
'src/**/*.svelte',
'src/app.d.ts',
'src/app.html',
'src/hooks.client.ts',
'src/hooks.server.ts',
'src/service-worker.ts'
],
reporter: ['text', 'lcov', 'html'],
thresholds: {
global: {
statements: 85,
branches: 85,
functions: 85,
lines: 85
}
}
}
}
});