Add component test (Vitest) (#681)

* Add component test (Vitest)

* Fix compile error
This commit is contained in:
Chenlei Hu
2024-08-29 14:44:09 -04:00
parent 877e500510
commit 9009e784f9
7 changed files with 638 additions and 1 deletions

15
vitest.config.ts Normal file
View File

@@ -0,0 +1,15 @@
import { defineConfig } from 'vitest/config'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [vue()],
test: {
globals: true,
environment: 'happy-dom',
setupFiles: ['./vitest.setup.ts'],
include: ['**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
coverage: {
reporter: ['text', 'json', 'html']
}
}
})