配 vitest:jsdom 环境与覆盖率

This commit is contained in:
hrz 2026-09-02 20:14:45 +08:00
parent 975bbe2cfd
commit e58de03be2
3 changed files with 19 additions and 1 deletions

View file

@ -7,7 +7,9 @@
"check:i18n": "node scripts/check-i18n.js",
"test:snapshot": "node --test src/components/agentSnapshotDisplayUtils.test.mjs src/apis/module/agentSnapshotApi.test.mjs",
"build": "vue-cli-service build",
"test:unit": "node --test tests/*.test.mjs",
"test:contract": "node --test tests/*Contract.test.mjs",
"test:unit": "vitest run",
"test": "npm run test:contract && npm run test:unit",
"analyze": "cross-env ANALYZE=true vue-cli-service build"
},
"dependencies": {

View file

@ -0,0 +1,16 @@
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
environment: 'jsdom',
globals: false,
include: ['tests/**/*.test.{js,mjs}'],
exclude: ['tests/*Contract.test.mjs', 'node_modules/**'],
passWithNoTests: true,
coverage: {
provider: 'v8',
reporter: ['text', 'html'],
include: ['src/utils/**', 'src/store/**'],
},
},
});