-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.config.ts
71 lines (69 loc) · 1.64 KB
/
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
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import { sveltekit } from '@sveltejs/kit/vite';
import { svelteTesting } from '@testing-library/svelte/vite';
import { resolve } from 'path';
import { type UserConfig } from 'vite';
import { defineConfig } from 'vitest/config';
import { defineViteReplacements, readCanisterIds } from './vite.utils';
process.env = {
...process.env,
...readCanisterIds({ prefix: 'VITE_' })
};
export default defineConfig(
(): UserConfig => ({
plugins: [sveltekit(), svelteTesting()],
resolve: {
alias: [
{
find: '$lib',
replacement: resolve(__dirname, 'src/frontend/src/lib')
},
{
find: '$routes',
replacement: resolve(__dirname, 'src/frontend/src/routes')
},
{
find: '$btc',
replacement: resolve(__dirname, 'src/frontend/src/btc')
},
{
find: '$eth',
replacement: resolve(__dirname, 'src/frontend/src/eth')
},
{
find: '$icp',
replacement: resolve(__dirname, 'src/frontend/src/icp')
},
{
find: '$icp-eth',
replacement: resolve(__dirname, 'src/frontend/src/icp-eth')
},
{
find: '$tests',
replacement: resolve(__dirname, 'src/frontend/src/tests')
},
{
find: '$env',
replacement: resolve(__dirname, 'src/frontend/src/env')
},
{
find: '$declarations',
replacement: resolve(__dirname, 'src/declarations')
}
]
},
define: {
...defineViteReplacements()
},
test: {
environment: 'jsdom',
globals: true,
watch: false,
silent: false,
setupFiles: ['./vitest.setup.ts'],
include: ['./src/**/*.{test,spec}.?(c|m)[jt]s?(x)'],
coverage: {
exclude: ['build', '.dfx', '**/.svelte-kit']
}
}
})
);