From 0e75d132a7e98dfbef62bb29b701942e782d3c4f Mon Sep 17 00:00:00 2001 From: Suzumiya Date: Sun, 4 Oct 2026 14:48:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=BF=90=E8=A1=8C=E9=A1=B5?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E7=94=A8=E4=BE=8B=E7=9A=84=20preview=20?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=EF=BC=9A=E6=94=B9=E7=94=A8=20GameCreationApp?= =?UTF-8?q?PreviewState?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - runPreviewRefresh 的 preview 形参从自造字面量类型改为契约类型,避免 status 被放宽成 string 与 view 的 props 冲突(tsconfig.tests.json 才会覆盖 tests/ 目录,此前只跑 tsc -p tsconfig.json 漏检) - 已跑 npm run ai-game-creator-shell:typecheck(含 check:tests:types)与定向用例确认通过 --- .../ai-game-creator-shell/tests/runPreviewRefresh.test.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/ai-game-creator-shell/tests/runPreviewRefresh.test.tsx b/apps/ai-game-creator-shell/tests/runPreviewRefresh.test.tsx index a78377746..c0fa9213e 100644 --- a/apps/ai-game-creator-shell/tests/runPreviewRefresh.test.tsx +++ b/apps/ai-game-creator-shell/tests/runPreviewRefresh.test.tsx @@ -2,7 +2,10 @@ import { cleanup, fireEvent, render, screen } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import { createGameCreationAppManifest } from '../../../packages/shared/src/contracts/gameCreationApp'; +import { + createGameCreationAppManifest, + type GameCreationAppPreviewState, +} from '../../../packages/shared/src/contracts/gameCreationApp'; import ProjectDevelopmentView from '../src/view/project-development'; import { installTauriRuntime } from './tauriRuntimeFake'; @@ -38,7 +41,7 @@ function installInvoke() { } function renderRunView( - preview: { status: string; url: string | null; port: number | null } = { + preview: GameCreationAppPreviewState = { status: 'running', url: PREVIEW_URL, port: 4173,