-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvitest.config.ts
65 lines (63 loc) · 1.46 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
/// <reference types="vitest" />
import AutoImport from 'unplugin-auto-import/vite'
import { defineConfig } from 'vitest/config'
import Vue from '@vitejs/plugin-vue'
import { configure } from '@testing-library/vue'
configure({})
export default defineConfig({
test: {
environment: 'jsdom',
typecheck: {
tsconfig: './tests/tsconfig.json'
}
},
resolve: {
alias: {
'~': __dirname
}
},
plugins: [
AutoImport({
imports: [
'vue',
{
'/tests/testutils/nuxtMocks': [
'defineNuxtPlugin',
'useRuntimeConfig',
'useAppConfig',
'useState',
'useContent',
'useProjectProperties',
'useNavigationData',
'useRoute',
'useRouter',
'useNuxtApp',
'useHead',
'useDev',
'navigateTo',
'createError',
'definePageMeta',
'useLocale',
'useAsyncData',
'fetchTopLevelNavigation',
'fetchPageRoute',
'fetchDatasetById',
'fetchPageById',
'fetchNavigationItemFromRoute',
'fetchProducts',
'getLocaleFromNavigationItem'
]
}
]
}),
Vue({
template: {
compilerOptions: {
isCustomElement: (tag) => {
return ['DevOnly', 'ClientOnly', 'NuxtLink'].includes(tag)
}
}
}
})
]
})