用途:运行测试、分析测试结果,并在需要时修复失败的测试。
主要能力:自动检测测试框架(检查 package.json 中的 test 脚本,查找 vitest.config.ts、jest.config.ts、playwright.config.ts);按框架执行测试;解析测试输出、识别失败项、检查覆盖率指标;在要求时读取失败测试文件、定位问题并提出修复方案。
常用命令(保持原样):单元测试 npm run test -- $ARGUMENTS;带覆盖率 npm run test -- --coverage $ARGUMENTS;E2E npm run test:e2e -- $ARGUMENTS。Vitest:npx vitest run、npx vitest run path/to/test、npx vitest --coverage。Jest:npx jest、npx jest path/to/test、npx jest --coverage。Playwright:npx playwright test、npx playwright test file、npx playwright test --ui。
输出格式:包含 Test Results 的 Summary(总数、通过、失败、覆盖率)、Failures、Coverage Gaps、Recommendations。目标由 $ARGUMENTS 传入。
覆盖率要求:Domain 层 100%,Application 层 90%,组件 80%。
限制:具体配置、依赖安装与 CI 集成方式暂未提供。