-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvitest.config.ts
60 lines (58 loc) · 1.63 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
import path from 'path'
import { presetIcons, presetAttributify, presetUno } from 'unocss'
import { defineConfig } from 'vitest/config'
import vue from '@vitejs/plugin-vue'
import svgLoader from 'vite-svg-loader'
import Components from 'unplugin-vue-components/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import AutoImport from 'unplugin-auto-import/vite'
import UnoCSS from 'unocss/vite'
const include = [/\.vue$/, /\.vue\?vue/, /\.stories\.ts$/, /\.[tj]s$/]
export default defineConfig({
resolve: {
alias: {
'~': path.resolve(__dirname)
}
},
plugins: [
vue(),
Components({
dirs: ['~/components'],
directoryAsNamespace: true,
resolvers: [NaiveUiResolver()],
include
}),
AutoImport({
include,
imports: ['vue', '@vueuse/head'],
dirs: ['~/composables'],
vueTemplate: true
}),
svgLoader(),
UnoCSS({
presets: [
presetAttributify({ /* preset options */}),
presetIcons({ /* options */ }),
presetUno()
// ...custom presets
]
})
],
test: {
globalSetup: ['./tests/setupSqliteDbEnv'],
globals: true,
environment: 'jsdom',
threads: false,
coverage: {
enabled: true,
// We want to catch all js/ts/... files, not only the ones imported in some tests
// see https://github.com/bcoe/c8#checking-for-full-source-coverage-using---all
all: true,
include: [
// Nuxt 3 framework folders and files sources from directory structure here: https://nuxt.com/docs/guide/directory-structure/nuxt
'components',
'composables'
]
}
}
})