-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
57 lines (53 loc) · 1.36 KB
/
Copy pathvite.config.js
File metadata and controls
57 lines (53 loc) · 1.36 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
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vitest/config';
import path from 'path';
export default defineConfig({
plugins: [sveltekit()],
// Test configuration
test: {
name: 'Language-map Tests',
environment: 'jsdom',
include: [
'tests/model/**/*.{test,spec}.{js,ts}',
'tests/unit/**/*.{test,spec}.{js,ts}',
'tests/endpoints/**/*.{test,spec}.{js,ts}'
],
globals: true,
setupFiles: ['./tests/setup.js'],
deps: {
inline: [/svelte/] // Important for Svelte component testing
},
coverage: {
provider: 'v8',
reporter: ['text', 'json-summary', 'json'],
include: ['src/lib/**/*.{js,ts}'],
exclude: [
'src/lib/model',
'src/lib/components',
'src/lib/server/cache.ts',
'**/node_modules/**',
'**/dist/**',
'**/.svelte-kit/**',
'**/build/**'
],
reportOnFailure: true
}
},
// Server configuration
server: {
port: 5173
},
// Path resolution
resolve: {
alias: {
// These should already be handled by SvelteKit, but explicitly defining
// them helps Vitest during testing
'$lib': path.resolve('./src/lib'),
// For tests, we need to mock $app imports
...(process.env.VITEST ? {
'$app': path.resolve('./tests/mocks/app')
} : {}
)
}
}
});