refactor: vitest config

Signed-off-by: Ryan Wang <i@ryanc.cc>
pull/592/head
Ryan Wang 2022-08-01 17:41:39 +08:00
parent 9c37f16b63
commit 425ab3a480
5 changed files with 24 additions and 17 deletions

View File

@ -65,7 +65,7 @@
"@types/uuid": "^8.3.4",
"@vitejs/plugin-vue": "^2.3.3",
"@vitejs/plugin-vue-jsx": "^1.3.10",
"@vitest/ui": "^0.19.1",
"@vitest/ui": "^0.20.2",
"@vue/compiler-sfc": "^3.2.37",
"@vue/eslint-config-prettier": "^7.0.0",
"@vue/eslint-config-typescript": "^11.0.0",
@ -95,7 +95,7 @@
"vite-plugin-pwa": "^0.12.3",
"vite-plugin-static-copy": "^0.7.0",
"vite-plugin-vue-setup-extend": "^0.4.0",
"vitest": "^0.19.1",
"vitest": "^0.20.2",
"vue-tsc": "^0.39.2"
}
}

View File

@ -26,7 +26,7 @@ importers:
'@types/uuid': ^8.3.4
'@vitejs/plugin-vue': ^2.3.3
'@vitejs/plugin-vue-jsx': ^1.3.10
'@vitest/ui': ^0.19.1
'@vitest/ui': ^0.20.2
'@vue/compiler-sfc': ^3.2.37
'@vue/eslint-config-prettier': ^7.0.0
'@vue/eslint-config-typescript': ^11.0.0
@ -67,7 +67,7 @@ importers:
vite-plugin-pwa: ^0.12.3
vite-plugin-static-copy: ^0.7.0
vite-plugin-vue-setup-extend: ^0.4.0
vitest: ^0.19.1
vitest: ^0.20.2
vue: ^3.2.37
vue-filepond: ^7.0.3
vue-grid-layout: 3.0.0-beta1
@ -114,7 +114,7 @@ importers:
'@types/uuid': 8.3.4
'@vitejs/plugin-vue': 2.3.3_vite@2.9.14+vue@3.2.37
'@vitejs/plugin-vue-jsx': 1.3.10
'@vitest/ui': 0.19.1
'@vitest/ui': 0.20.2
'@vue/compiler-sfc': 3.2.37
'@vue/eslint-config-prettier': 7.0.0_vvfpqh5kol6rhqy7beehv5uezq
'@vue/eslint-config-typescript': 11.0.0_q5rilqo35fn7bz5lzyqkzahbb4
@ -144,7 +144,7 @@ importers:
vite-plugin-pwa: 0.12.3_vite@2.9.14
vite-plugin-static-copy: 0.7.0_vite@2.9.14
vite-plugin-vue-setup-extend: 0.4.0_vite@2.9.14
vitest: 0.19.1_yd3cwv4taezjka3osf5hwzne7e
vitest: 0.20.2_j3osldloloqgmgk2ygg4hsxweu
vue-tsc: 0.39.2_typescript@4.7.4
packages/components:
@ -2759,8 +2759,8 @@ packages:
vue: 3.2.37
dev: true
/@vitest/ui/0.19.1:
resolution: {integrity: sha512-TmbEJmcieK7chFJqdkgni4Lq/2MY6fKoxGPktromnnyabBkQFSGJlAl5vzFMYy8SfCj/zyaZy48FzDdWixziKg==}
/@vitest/ui/0.20.2:
resolution: {integrity: sha512-jMQzuxsiZ7SnEYQdWJwyNav/LbakR2rVJ45XFGK3e/xlhqRYV2hI/byyl4iw07kM9kCY43aK7N36i/53O5I+Vg==}
dependencies:
sirv: 2.0.2
dev: true
@ -8110,8 +8110,8 @@ packages:
fsevents: 2.3.2
dev: true
/vitest/0.19.1_yd3cwv4taezjka3osf5hwzne7e:
resolution: {integrity: sha512-E/ZXpFMUahn731wzhMBNzWRp4mGgiZFT0xdHa32cbNO0CSaHpE9hTfteEU247Gi2Dula8uXo5vvrNB6dtszmQA==}
/vitest/0.20.2_j3osldloloqgmgk2ygg4hsxweu:
resolution: {integrity: sha512-AFXTHrwG4d2OO6SAL8WP5ZkOwLtgeF4tlrHfXFqrHc+5chNegeR53pge0lv/C4316SqJ2DbYaUBH8vh3CdF+BQ==}
engines: {node: '>=v14.16.0'}
hasBin: true
peerDependencies:
@ -8138,7 +8138,7 @@ packages:
'@types/chai': 4.3.1
'@types/chai-subset': 1.3.3
'@types/node': 17.0.45
'@vitest/ui': 0.19.1
'@vitest/ui': 0.20.2
c8: 7.12.0
chai: 4.3.6
debug: 4.3.4

View File

@ -1,4 +1,4 @@
<script lang="ts" name="UserCreationModal" setup>
<script lang="ts" name="UserEditingModal" setup>
import type { PropType } from "vue";
import { computed, onMounted, ref, watch } from "vue";
import { apiClient } from "@halo-dev/admin-shared";

View File

@ -83,10 +83,5 @@ export default ({ mode }: { mode: string }) => {
build: {
chunkSizeWarningLimit: 2048,
},
test: {
transformMode: {
web: [/\.[jt]sx$/],
},
},
});
};

View File

@ -1,7 +1,19 @@
import { defineConfig } from "vitest/config";
import Vue from "@vitejs/plugin-vue";
import VueJsx from "@vitejs/plugin-vue-jsx";
import { fileURLToPath, URL } from "url";
export default defineConfig({
plugins: [Vue(), VueJsx()],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
test: {
dir: "./src",
transformMode: {
web: [/\.[jt]sx$/],
},
},
});