This commit is contained in:
z.ai committed 2026-10-08 11:09:37 +08:00
1 parent c1541b80df
commit b4c7908029
97 files changed
+12403 -154

No files matched your search

@@ -0,0 +1,37 @@
# 测试规范
## 分层
- 单元测试:纯函数、工具、校验
- 集成测试:API、DB、服务
- 端到端:主链路
## 工具
- Vitest:单元 + 集成
- Playwright:端到端
- MSW:mock 网络
## 用例设计
每个功能至少覆盖:
- happy path
- 空值 / 缺字段
- 非法输入
- 权限不足
- 资源不存在
- 并发或重复提交
## 命名
- describe("createPost", () => {
- it("creates a post with valid input", ...)
- it("rejects empty title", ...)
- })
## CI
- push 触发 lint + typecheck + test
- 主分支保护
- 失败阻断合并