feat(mock): 新增 POST API Mock 支持 AI 自动测试
在 Vitest 测试环境下自动拦截 POST 请求并返回 Mock 数据, 保护后端数据安全,支持 AI 自动测试。 改动: - src/utils/request.js: 添加测试环境检测和 POST Mock 路由 - src/utils/mockData.js: 新增 9 个模块的 POST Mock 函数 - src/utils/__tests__/postMock.test.js: 新增 18 个测试用例 支持的 POST API: - favorite (收藏/取消收藏) - event (埋点) - sms (验证码) - upload (文件上传/七牛) - openid (小程序授权) - proposal (计划书操作) - user (登录/登出/更新资料) - feedback (意见反馈) - wx_pay (微信支付) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Showing
3 changed files
with
496 additions
and
0 deletions
src/utils/__tests__/postMock.test.js
0 → 100644
-
Please register or login to post a comment