Files
hfb_sys/frontend
yml 965832c3cb 前端测试基建: vitest.config + jsdom + test script, 3 个死 spec 复活
现状: vitest 已装, 3 个 spec 已存在 (listings composables, 14 用例), 但跑不起来——package.json 无 test script, 无 vitest.config, @/ 别名在测试环境不通 (Cannot find package '@/...')。

修复:
- 新增 vitest.config.ts: jsdom 环境 (提供 window/document/navigator, 让 monitor.ts 等浏览器模块可加载) + @ 别名 (与 vite.config.ts 同口径) + globals + v8 coverage 配置
- package.json 加 test / test:watch / test:coverage script
- 装 jsdom devDependency
- check.sh 前端门禁加 npm run test 步骤 (受 --skip-tests 控制, 与后端测试一致)

验证: npm run test 3 spec 全过 (14 用例); check.sh --skip-backend 全绿 (check + test + build)。

之前 "有测试实际跑不起来" 的债务清掉。后续 composable/api 层测试可直接 npm run test。
2026-06-14 18:13:06 +08:00
..
2026-06-08 06:40:33 +08:00
2026-06-12 21:57:49 +08:00
2026-05-22 15:05:28 +08:00
2026-06-08 19:44:07 +08:00