-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.config.ts
32 lines (31 loc) · 1002 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
28
29
30
31
32
import { defineConfig } from 'vitest/config';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import { resolve } from 'path';
// Why do the alias not work in vite.config.ts?
export default defineConfig(({ mode }) => ({
plugins: [svelte({
compilerOptions: { hmr: !process.env.VITEST }
})],
resolve: {
conditions: mode === 'test' ? ['browser'] : [],
alias: {
$lib: resolve(__dirname, 'src/lib'),
$components: resolve(__dirname, 'src/components'),
$routes: resolve(__dirname, 'src/routes'),
'$app/stores': resolve(__dirname, 'test/__mocks__/stores'),
'$app/navigation': resolve(__dirname, 'test/__mocks__/navigation'),
},
},
test: {
server: {
deps: { inline: ['@sveltejs/kit'] },
},
environment: 'jsdom',
globals: true,
reporters: 'basic',
coverage: {
include: ['src/**'],
},
include: ['test/e2e/*.{test,spec}.?(c|m)[jt]s?(x)', 'test/unit-and-integration/*.{test,spec}.?(c|m)[jt]s?(x)'],
}
}));