-
Notifications
You must be signed in to change notification settings - Fork 244
/
vitest.config.ts
46 lines (45 loc) · 1.15 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
import path from 'path'
import { defineConfig } from 'vitest/config'
import vue from '@vitejs/plugin-vue'
import jsx from '@vitejs/plugin-vue-jsx'
import Components from 'unplugin-vue-components/vite'
export default defineConfig({
plugins: [
vue(),
jsx(),
// We need this plugin to test for stubbing a script setup component
// imported by it.
// https://github.com/antfu/unplugin-vue-components/issues/429
Components({
dts: false,
include: /AutoImportScriptSetup\.vue$/,
dirs: ['tests/components']
})
],
define: {
__USE_BUILD__: process.env.NODE_ENV !== 'test-build',
__BROWSER__: true,
__USE_PREFIX_IDENTIFIERS__: true
},
test: {
environment: 'jsdom',
pool: 'vmThreads',
setupFiles: [path.resolve(__dirname, './setup.js')],
include: ['tests/**/*.spec.ts'],
server: {
deps: {
inline: ['vue', '@vue/compat']
}
},
sequence: {
shuffle: true
}
},
resolve: {
extensions: ['.vue', '.js', '.json', '.jsx', '.ts', '.tsx', '.node'],
dedupe: ['vue', '@vue/compat'],
alias: {
'@vue/compat': '@vue/compat/dist/vue.esm-bundler.js'
}
}
})