-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvitest.config.js
42 lines (40 loc) · 961 Bytes
/
vitest.config.js
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
// I have copy and pasted this config as this is what's required for Nuxt 3 & Vue testing
// I modified it a bit; such as adding custom Nuxt elements so it will not give false warnings.
import path from "path";
import { defineConfig } from "vitest/config";
import Vue from "@vitejs/plugin-vue";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import VueTypeImports from "vite-plugin-vue-type-imports";
export default defineConfig({
plugins: [
Vue({
template: {
compilerOptions: {
isCustomElement: (tag) => ["nuxt-link"].includes(tag),
}
}
}),
VueTypeImports(),
AutoImport({
imports: ["vue"]
}),
Components({
dirs: ["components"],
directoryAsNamespace: true
}),
],
test: {
globals: true,
environment: "jsdom",
deps: {
inline: [/@nuxt\/test-utils-edge/],
}
},
root: ".",
resolve: {
alias: {
"~": path.resolve(__dirname, "."),
},
},
});