feat(scripts): legacy-layer → Cocos prefab 批量迁移完成(7 ok / 6 expected-fail)

This commit is contained in:
2026-09-02 08:45:18 +08:00
parent 601de1f903
commit 7e0a8b79a4
16 changed files with 13949 additions and 156 deletions
@@ -1,6 +1,7 @@
// 递归收集 framework-tests 下所有 *.test.ts 交给 node 测试运行器。
// 递归收集 framework-tests 下所有 *.test.{ts,mjs} 交给 node 测试运行器。
// node --test 的 glob 模式需 v20.14+,本仓库当前 node 20.13.x 不支持,
// 故用此零依赖、跨平台 runner 显式枚举文件,保持 test:framework 行为一致。
// *.test.mjs: legacy-layer-migration 等纯 ESM 脚本测试 (Tasks 9-12 legacy 迁移管线).
import { readdirSync, statSync } from 'node:fs';
import { join } from 'node:path';
import { spawnSync } from 'node:child_process';
@@ -11,12 +12,12 @@ const files = [];
for (const entry of readdirSync(dir)) {
const p = join(dir, entry);
if (statSync(p).isDirectory()) walk(p);
else if (p.endsWith('.test.ts')) files.push(p);
else if (p.endsWith('.test.ts') || p.endsWith('.test.mjs')) files.push(p);
}
})(root);
if (files.length === 0) {
console.error(`[run-framework-tests] 未发现任何 *.test.ts(root=${root})`);
console.error(`[run-framework-tests] 未发现任何 *.test.{ts,mjs}(root=${root})`);
process.exit(1);
}