Files
Genarrative/vitest.config.ts
T
AIGameCreator App a36290b2e5
Project CI / Frontend tests (push) Failing after 27s
Project CI / Repository checks (push) Successful in 3m20s
Project CI / Backend tests (push) Successful in 3m52s
Project CI / Native shell tests (push) Successful in 13m19s
合并AI游戏创作智能体与通用Runtime基座
合并 codex/ai-game-creator-app 的独立客户端、多智能体 Runtime、Runner 与可扩展 LLM Provider 能力
保留 master 最新画布、钱包、后端和原生壳约束并完成四处语义化冲突合并
补齐根 Vitest 对独立 Tauri guest 模块的隔离测试别名并保持 HostBridge 依赖边界
统一正式工作台与 game-chat 的安全本地预览组件及 native-shell 静态门禁
修复合并态 Rust 格式、前端 lint 与共享文档验证口径
2026-07-30 18:01:19 +08:00

85 lines
3.5 KiB
TypeScript

import path from 'node:path';
import { defineConfig } from 'vitest/config';
export default defineConfig({
resolve: {
alias: {
// Keep shared components' application-root imports resolvable in tests.
'@': path.resolve(__dirname, '.'),
// The standalone AI shell owns its Tauri guest dependencies. Root tests
// use inert aliases so the root H5 package keeps the HostBridge boundary.
'@tauri-apps/plugin-clipboard-manager': path.resolve(
__dirname,
'apps/ai-game-creator-shell/tests/tauri-plugin-clipboard-manager.mock.ts',
),
'@tauri-apps/plugin-opener': path.resolve(
__dirname,
'apps/ai-game-creator-shell/tests/tauri-plugin-opener.mock.ts',
),
// The AI shell has its own install for standalone Tauri builds. Keep root
// Vitest on a single React renderer even after that scoped install exists.
react: path.resolve(__dirname, 'node_modules/react'),
'react-dom': path.resolve(__dirname, 'node_modules/react-dom'),
},
dedupe: ['react', 'react-dom', 'zustand'],
},
test: {
environment: 'node',
globals: true,
minThreads: 1,
maxThreads: 8,
server: {
deps: {
inline: [/apps\/ai-game-creator-shell\/node_modules\//],
},
},
include: [
'src/index.test.ts',
'src/routing/activeAppPageRoutes.test.ts',
'src/routing/activeAppRoutes.test.ts',
'src/services/activeAppTitle.test.ts',
'src/services/authService.test.ts',
'src/services/apiClient.test.ts',
'src/services/clipboard.test.ts',
'src/services/host-bridge/**/*.test.ts',
'src/services/image-editor/**/*.test.ts',
'src/services/external-generation/**/*.test.ts',
'src/services/payment/**/*.test.ts',
'src/components/auth/**/*.test.ts',
'src/components/auth/**/*.test.tsx',
'src/components/creation-home/**/*.test.ts',
'src/components/creation-home/**/*.test.tsx',
'src/components/image-editor/**/*.test.ts',
'src/components/image-editor/**/*.test.tsx',
'src/components/project/**/*.test.ts',
'src/components/project/**/*.test.tsx',
'src/components/platform-entry/PlatformActiveProfileView.test.tsx',
'src/components/platform-entry/PlatformEntryActiveFlowShell.test.tsx',
'src/components/platform-entry/PlatformProfileModalShell.test.tsx',
'src/components/platform-entry/PlatformProfileQrScannerModal.test.tsx',
'src/components/platform-entry/PlatformProfileRechargeModal.test.tsx',
'src/components/platform-entry/PlatformProfileReferralModal.test.tsx',
'src/components/platform-entry/PlatformProfileRewardCodeRedeemModal.test.tsx',
'src/components/platform-entry/PlatformProfileTaskCenterModal.test.tsx',
'src/components/platform-entry/PlatformProfileWalletLedgerModal.test.tsx',
'src/components/platform-entry/platformProfile*.test.ts',
'src/components/platform-entry/usePlatformProfileCenterController.test.tsx',
'src/hooks/useHostNavigationCanGoBack.test.tsx',
'apps/admin-web/src/**/*.test.ts',
'apps/admin-web/src/**/*.test.tsx',
'apps/ai-game-creator-shell/tests/**/*.test.ts',
'miniprogram/**/*.test.js',
'scripts/**/*.test.ts',
'packages/shared/src/contracts/hostBridge.test.ts',
'packages/shared/src/components/**/*.test.ts',
'packages/shared/src/components/**/*.test.tsx',
'packages/shared/src/utils/**/*.test.ts',
],
exclude: [
'apps/admin-web/src/pages/AdminCreationEntrySwitchPage.test.tsx',
'scripts/loadtest/**',
],
},
});