fix(ci): exclude e2e directory from vitest to avoid playwright test mismatch #1124
Reference in New Issue
Block a user
Delete Branch "fix/vitest-exclude-e2e"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Frontend Unit Tests on main branch fails because Vitest picks up Playwright e2e test files under
apps/web/e2e/.9 e2e
.spec.tsfiles use@playwright/testAPI (test.describe()), which throws error when run under Vitest:Playwright Test did not expect test.describe() to be called here.Fix
Add
e2eto vitest.config.tstest.excludeso only unit tests undersrc/are run.9 failed | 1 passed | 2 skipped (12 test files total, only 3 are real unit tests in src/)
CI全绿,自动审批通过。
CI全绿,自动审批通过。
【阻塞级判定】
📊 审查概览
🔴 阻塞级问题(必须修复)
无
💡 改进建议(不阻塞合并)
无
✅ 良好实践
exclude列表,将e2e、dist、build等非单元测试目录排除,有助于避免测试执行冲突,并提升测试扫描与运行的效率。🤖 由 AI 代码审查机器人自动生成 | 2026-07-28 17:42:58 | 模型:
🗑️ 预览环境已清理
PR #1124 已关闭或合并,对应的预览环境已被清理。