-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
45 lines (44 loc) · 1.08 KB
/
Copy pathvitest.config.ts
File metadata and controls
45 lines (44 loc) · 1.08 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
import { defineConfig } from 'vitest/config';
import { sveltekit } from '@sveltejs/kit/vite';
import tailwindcss from '@tailwindcss/vite';
import path from 'path';
export default defineConfig({
plugins: [tailwindcss(), sveltekit()],
test: {
globals: true,
environment: 'jsdom',
include: ['src/**/*.{test,spec}.{js,ts}'],
exclude: ['src/**/*.svelte.{test,spec}.{js,ts}', 'tests/**/*'],
coverage: {
provider: 'v8',
reporter: ['text', 'html', 'lcov'],
exclude: [
'node_modules/',
'src/**/*.test.ts',
'src/**/*.spec.ts',
'.svelte-kit/',
'build/',
'dist/',
'vite.config.ts',
'vitest.config.ts',
'playwright.config.ts'
]
},
setupFiles: ['./vitest-setup.ts'],
// Ensure mocks are resolved before module imports
pool: 'forks',
poolOptions: {
forks: {
singleFork: true
}
}
},
resolve: {
alias: {
$lib: path.resolve('./src/lib'),
$app: path.resolve('./src/app'),
'$env/static/private': path.resolve('./src/test/mocks/env-private.ts'),
'$app/environment': path.resolve('./src/test/mocks/app-environment.ts')
}
}
});