frontend-phase-test-gate-r1.md
1.93 KB
前端阶段 硬测试闸 证据(frontend-phase-test-gate)
- attempt: 1
- phase: frontend
- 分支: frontend-phase
- 命令:
npm run test:unit && npm run test:e2e(来源 docs/04-技术规范.md § 零 命令清单:前端 unit=vitest run、e2e=playwright test) - 工作目录:
/Users/reporkey/Desktop/mvp/test6/frontend - 执行方式: 派发独立(detached)子执行进程跑测试,主会话仅消费结构化结果,未在主会话直接跑测试。
结论
GREEN — 两个套件 exit_code 均为 0,failed = 0,覆盖全部 FE 回归(vitest + playwright)。
单元测试(vitest)
- 命令:
npm run test:unit(=vitest run) - 时间窗口: 2026-06-02 09:26:46 → 09:26:53
- exit_code: 0
- 结果: Test Files 40 passed (40) / Tests 193 passed (193)
- 备注: 日志中
window.getComputedStylenot implemented 与 React Router v7 future flag 为 jsdom/antd 的非致命 stderr 警告,未导致任何用例失败。
E2E 测试(playwright)
- 命令:
npm run test:e2e(=playwright test,chromium 项目,webServer 起 Vite dev server 5173,后端经page.route桩,不依赖真实后端) - 时间窗口: 2026-06-02 09:26:57 → 09:27:04
- exit_code: 0
- 结果: 20 passed (6.4s)
- 覆盖 spec:
login.spec.ts/shell.spec.ts/userlist.spec.ts/userdetail.spec.ts - 备注: 日志中
[vite] http proxy error ... ECONNREFUSED为 dev server 代理向未启动的真实后端转发产生,E2E 用例已用page.route拦截/api/**,与用例断言无关,全部用例通过。
子会话结构化返回
{
"unit": {
"command": "npm run test:unit",
"exit_code": 0,
"passed": 193,
"failed": 0,
"stdout_excerpt": "Test Files 40 passed (40)\nTests 193 passed (193)\nDuration 6.12s"
},
"e2e": {
"command": "npm run test:e2e",
"exit_code": 0,
"passed": 20,
"failed": 0,
"stdout_excerpt": "20 passed (6.4s)"
}
}