docs(plan): Task 13 勾选——阶段 1 验收:globalSetup 临时库 + 空库一键迁移

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-10-20 20:43:24 +08:00
parent f1c181de02
commit 622c2b09d8
@@ -799,7 +799,7 @@ CREATE UNIQUE INDEX route_exact_uq ON route_registry (site_id, host, exact_route
---
### Task 13: 空库一键迁移测试(阶段 1 验收)
### Task 13: 空库一键迁移测试(阶段 1 验收)✅ 完成(commit f1c181d,globalSetup 临时库 sf_test_<ts> + drizzle-orm 程序化迁移器 + helpers 公共夹具收敛;75 测试全绿(72+3);实证开发库 21 表行数总和 0、无 sf_test_* 残留;发现并绕过 vitest 2 globalSetup 加载器陷阱——有 default 导出时不捕获具名 teardown,须双具名导出)
**Files:**
- Create: `scripts/migrate-test.sh` 与 `tests/integration/db.full-migrate.test.ts`(重构公共夹具 `tests/integration/helpers.ts`:建临时库 sf_test_<ts> → 迁移 → 传连接串给测试 → 结束 drop)