feat: 接入旧站管理端并完整迁移后台能力
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
import { defineConfig } from 'vitest/config'
|
||||
|
||||
// Vitest 配置:独立于 vite.config.ts,仅配置测试所需。
|
||||
// - environment: jsdom 提供 window/document/navigator,支持引用浏览器全局的模块(如 monitor.ts)
|
||||
// - alias: 与 vite.config.ts 保持一致,让 @/ 别名在测试中可用
|
||||
// - globals: 让 describe/it/expect 全局可用(与现有 spec 的 import 风格兼容,不强制)
|
||||
export default defineConfig({
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
},
|
||||
},
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
globals: true,
|
||||
include: ['src/**/*.{spec,test}.ts'],
|
||||
coverage: {
|
||||
provider: 'v8',
|
||||
reporter: ['text', 'json-summary'],
|
||||
include: [
|
||||
'src/features/admin/api/adminPayments.ts',
|
||||
'src/features/admin/utils/adminOrderPresentation.ts',
|
||||
'src/features/orders/composables/useOrderPaymentCashier.ts',
|
||||
'src/features/wallet/api/wallet.ts',
|
||||
'src/features/wallet/api/withdrawal.ts',
|
||||
],
|
||||
thresholds: {
|
||||
statements: 80,
|
||||
branches: 70,
|
||||
functions: 80,
|
||||
lines: 80,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user