Files
Genarrative/vitest.config.ts
T
lhk229 a68a9621a7
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 7m4s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 6m12s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m43s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 7m7s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 4m48s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m7s
Project CI / Repository checks (pull_request) Successful in 4m50s
Project CI / Frontend tests (pull_request) Successful in 5m52s
Project CI / Backend tests (pull_request) Successful in 9m13s
Project CI / Native shell tests (pull_request) Successful in 8m3s
Project CI / AI game creator shell web tests (pull_request) Successful in 5m0s
修复前端测试状态泄漏与异步断言竞态
隔离创作主页换签网络请求并使用独立响应

恢复快捷键选择状态、持久化路由和UI编辑页宿主mock

修正虚拟树尺寸与选择时序并纳入换签Hook测试

记录全量与随机顺序测试验证方式
2026-09-17 11:56:17 +08:00

142 lines
5.3 KiB
TypeScript

import { createRequire } from 'node:module';
import path from 'node:path';
import { defineConfig } from 'vitest/config';
const aiGameCreatorRequire = createRequire(
path.resolve(__dirname, 'apps/ai-game-creator-shell/package.json'),
);
const reactFileManagerPackageRoot = path.dirname(
aiGameCreatorRequire.resolve('@cubone/react-file-manager/package.json'),
);
export default defineConfig({
resolve: {
alias: [
{
find: /^@cubone\/react-file-manager$/,
replacement: path.resolve(
reactFileManagerPackageRoot,
'dist/react-file-manager.es.js',
),
},
// Keep shared components' application-root imports resolvable in tests.
{ find: '@', replacement: path.resolve(__dirname, '.') },
{
find: '@genarrative/image-canvas-core',
replacement: path.resolve(
__dirname,
'packages/image-canvas-core/src/index.ts',
),
},
{
find: '@genarrative/image-canvas-react',
replacement: path.resolve(
__dirname,
'packages/image-canvas-react/src/index.ts',
),
},
// The standalone AI shell owns its Tauri guest dependencies. Root tests
// use inert aliases so the root H5 package keeps the HostBridge boundary.
{
find: '@tauri-apps/plugin-clipboard-manager',
replacement: path.resolve(
__dirname,
'apps/ai-game-creator-shell/tests/tauri-plugin-clipboard-manager.mock.ts',
),
},
{
find: '@tauri-apps/plugin-opener',
replacement: path.resolve(
__dirname,
'apps/ai-game-creator-shell/tests/tauri-plugin-opener.mock.ts',
),
},
// Keep every workspace test on the root install's single React renderer.
{
find: 'react',
replacement: path.resolve(__dirname, 'node_modules/react'),
},
{
find: 'react-dom',
replacement: 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\//,
/node_modules\/@cubone\/react-file-manager/,
],
},
},
include: [
'src/index.test.ts',
'src/routing/activeAppPageRoutes.test.ts',
'src/routing/activeAppRoutes.test.ts',
'src/services/activeAppTitle.test.ts',
'src/services/assetReadUrlService.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/services/platform-entry/platformProfileClient.test.ts',
'src/stores/**/*.test.ts',
'src/stores/**/*.test.tsx',
'src/components/auth/**/*.test.ts',
'src/components/auth/**/*.test.tsx',
'src/components/creation-home/**/*.test.ts',
'src/components/creation-home/**/*.test.tsx',
'src/components/shared-components/**/*.test.tsx',
'src/components/common/AutoGrowTextArea.test.tsx',
'src/components/common/CreativeImageInputPanel.test.tsx',
'src/components/common/PlatformDangerConfirmDialog.test.tsx',
'src/components/common/PlatformFloatingMenu.test.tsx',
'src/components/common/PlatformImagePreviewModal.test.tsx',
'src/components/common/PlatformReportDialog.test.tsx',
'src/components/common/PlatformUtilityInfoModal.test.tsx',
'src/components/common/PublishShareModal.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/PlatformActiveMobileWelcomeDialog.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/PlatformProfileReferralModal.test.tsx',
'src/components/platform-entry/PlatformProfileRewardCodeRedeemModal.test.tsx',
'src/components/platform-entry/platformProfile*.test.ts',
'src/components/platform-entry/usePlatformProfileCenterController*.test.tsx',
'src/hooks/useHostNavigationCanGoBack.test.tsx',
'src/hooks/useResolvedAssetReadUrl.test.tsx',
'apps/admin-web/src/**/*.test.ts',
'apps/admin-web/src/**/*.test.tsx',
'apps/ai-game-creator-shell/tests/**/*.test.ts',
'apps/ai-game-creator-shell/tests/**/*.test.tsx',
'miniprogram/**/*.test.js',
'scripts/**/*.test.ts',
'packages/shared/src/contracts/*.test.ts',
'packages/shared/src/components/**/*.test.ts',
'packages/shared/src/components/**/*.test.tsx',
'packages/shared/src/stores/**/*.test.ts',
'packages/shared/src/utils/**/*.test.ts',
'packages/image-canvas-core/src/**/*.test.ts',
'packages/image-canvas-react/src/**/*.test.ts',
'packages/image-canvas-react/src/**/*.test.tsx',
'packages/agc-plugin-sdk/src/**/*.test.ts',
],
exclude: ['scripts/loadtest/**'],
},
});