generated from logue/vite-vue2-vuetify-ts-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvitest.config.ts
62 lines (61 loc) · 1.57 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
import { defineConfig } from 'vitest/config';
import { VuetifyResolver } from 'unplugin-vue-components/resolvers';
import vue from '@vitejs/plugin-vue2';
import Components from 'unplugin-vue-components/vite';
import path from 'path';
/**
* Vitest Configure
*
* @see {@link https://vitest.dev/config/}
*/
export default defineConfig({
// Resolver
resolve: {
// https://vitejs.dev/config/shared-options.html#resolve-alias
alias: {
'@': `${path.resolve(__dirname, 'src')}`,
},
},
// plugins
plugins: [
{
name: 'vitest-plugin-beforeall',
config: () => ({
test: { setupFiles: ['./vitest/beforeAll.ts'] },
}),
} as any,
// Vue2
// https://github.com/vitejs/vite-plugin-vue2
vue(),
// unplugin-vue-components
// https://github.com/antfu/unplugin-vue-components
Components({
// generate `components.d.ts` global declarations
// https://github.com/antfu/unplugin-vue-components#typescript
dts: true,
// auto import for directives
directives: false,
// resolvers for custom components
resolvers: [
// Vuetify
VuetifyResolver(),
],
// https://github.com/antfu/unplugin-vue-components#types-for-global-registered-components
types: [
{
from: 'vue-router',
names: ['RouterLink', 'RouterView'],
},
],
}),
],
test: {
// https://vitest.dev/guide/#configuring-vitest
globals: true,
globalSetup: ['./vitest/setup.ts'],
environment: 'jsdom',
deps: {
inline: ['vuetify'],
},
},
});