-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathvite.config.ts
More file actions
34 lines (32 loc) · 994 Bytes
/
vite.config.ts
File metadata and controls
34 lines (32 loc) · 994 Bytes
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
import { sveltekit } from '@sveltejs/kit/vite';
import type { UserConfig } from 'vite';
import { configDefaults, type UserConfig as VitestConfig } from 'vitest/config';
const config: UserConfig & { test: VitestConfig['test'] } = {
plugins: [sveltekit()],
define: {
// Eliminate in-source test code
'import.meta.vitest': 'undefined',
},
test: {
// jest like globals
globals: true,
environment: 'jsdom',
// in-source testing
includeSource: ['src/**/*.{js,ts,svelte}'],
// Add @testing-library/jest-dom matchers & mocks of SvelteKit modules
setupFiles: ['./setupTests.ts'],
// Exclude files in c8
coverage: {
provider: 'c8',
reporter: ['text', 'html'],
exclude: ['setupTest.ts'],
},
deps: {
// Put Svelte component here, e.g., inline: [/svelte-multiselect/, /msw/]
inline: [],
},
// Exclude playwright tests folder
exclude: [...configDefaults.exclude, 'tests'],
},
};
export default config;