-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvitest.config.ts
27 lines (26 loc) · 896 Bytes
/
vitest.config.ts
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
import { defineConfig, mergeConfig, configDefaults } from 'vitest/config';
import viteConfig from './vite.config';
// https://vitest.dev/config/
// When using a separate vitest.config.js, you can also extend Vite's options from another config file if needed
export default mergeConfig(
viteConfig, //// Extending from an existing Vite configuration (`vite.config.ts` file)
defineConfig({
test: {
// Extending Vitest's default options
...configDefaults,
// 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: ['./src/setupTest.ts'],
// Exclude files in c8
coverage: {
exclude: ['./src/setupTest.ts']
},
// Exclude playwright tests folder
exclude: [...configDefaults.exclude, 'tests']
}
})
);