From 27be57bf688cea3ff2cc52c15d5a691b4a60c135 Mon Sep 17 00:00:00 2001 From: Suzumiya Date: Fri, 11 Sep 2026 18:57:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=8A=E4=B8=80=E6=9D=A1?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=87=8C=E9=94=99=E4=BD=8D=E7=9A=84=E5=88=AB?= =?UTF-8?q?=E5=90=8D=E8=A1=A8=E7=94=A8=E4=BE=8B=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 现象:提交 3082c3e85 把两条新增的 `decided` 表行(`'UI'`、`'font'`)插到了 `test.each(decided)` 的实参位置,`test.each` 拿到的是对象而不是回调,原来 7 条 `decided` 用例全部报 `fn2 is not a function` - 成因:pre-commit 的 lint-staged 对**部分暂存**文件做「隐藏未暂存改动 → 跑 prettier → 还原未暂存改动」时会重新落位 hunk,本次两条新增行落错了位置;该文件当时是部分暂存(提交 ① 只暂存了其中 3 个 hunk),因此被波及 - 修法:把两条行移回 `decided` 数组内的正确位置,`test.each(decided)` 恢复成「表 + 单回调」形态 - 本提交只暂存这一个文件(不部分暂存),避开同一成因 --- .../tests/assetKindCanonicalMapping.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/ai-game-creator-shell/tests/assetKindCanonicalMapping.test.ts b/apps/ai-game-creator-shell/tests/assetKindCanonicalMapping.test.ts index b0739ec5f..8ceb8ccc3 100644 --- a/apps/ai-game-creator-shell/tests/assetKindCanonicalMapping.test.ts +++ b/apps/ai-game-creator-shell/tests/assetKindCanonicalMapping.test.ts @@ -219,13 +219,13 @@ describe('真机出现的 kind 归类口径', () => { canonical: 'icon', category: 'ui-interaction', }, + // 现役写入侧的大写字面量与字体 kind,两者都必须落进明确栏目。 + { kind: 'UI', canonical: 'ui-design', category: 'ui-interaction' }, + { kind: 'font', canonical: 'document', category: 'document' }, ]; test.each(decided)( '$kind → $canonical → $category', - // 现役写入侧的大写字面量与字体 kind,两者都必须落进明确栏目。 - { kind: 'UI', canonical: 'ui-design', category: 'ui-interaction' }, - { kind: 'font', canonical: 'document', category: 'document' }, ({ kind, canonical, category }) => { expect(canonicalGameCreationAppAssetKind(kind)).toBe(canonical); expect(gameCreationAppAssetCategoryForKind(kind)).toBe(category);