test-running

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Test Running

运行测试

Run all appropriate tests according to repository guidelines.
按照仓库规范运行所有适用的测试。

When to Use This Skill

何时使用此技能

Use this skill:
  • After linting passes
  • Before staging changes for commit
  • After implementing a feature or bug fix
  • When verifying existing functionality still works
在以下场景使用此技能:
  • 代码检查通过后
  • 暂存提交的变更前
  • 完成功能开发或bug修复后
  • 验证现有功能是否仍正常工作时

Test Discovery

测试发现

Run tests according to repository guidelines. Look for test commands in:
  1. Repository documentation (
    README.md
    ,
    AGENTS.md
    ,
    CLAUDE.md
    , etc.)
  2. Package configuration (
    package.json
    ,
    Makefile
    ,
    pyproject.toml
    ,
    Cargo.toml
    , etc.)
  3. Standard test patterns for the project type
If no test guidelines are found or they are unclear, ask the user for clarification.
按照仓库规范运行测试。在以下位置查找测试命令:
  1. 仓库文档(
    README.md
    AGENTS.md
    CLAUDE.md
    等)
  2. 包配置文件(
    package.json
    Makefile
    pyproject.toml
    Cargo.toml
    等)
  3. 项目类型对应的标准测试模式
如果未找到测试规范或规范不明确,请向用户确认。

Common Test Commands

常见测试命令

bash
undefined
bash
undefined

JavaScript/TypeScript

JavaScript/TypeScript

npm test yarn test pnpm test
npm test yarn test pnpm test

Python

Python

pytest python -m pytest make test
pytest python -m pytest make test

Other

Other

./bin/test-* test
undefined
./bin/test-* test
undefined

Testing Process

测试流程

CRITICAL REQUIREMENT: 100% test success is MANDATORY.
For each test command found:
  1. Run it
  2. If ANY test failures occur, they MUST be fixed
  3. If issues can't be fixed immediately, stop and ask the user what to do next
  4. Only consider the task complete when ALL tests pass with 100% success rate OR the user explicitly gives permission to ignore certain failures
关键要求:必须100%测试通过。
对于找到的每个测试命令:
  1. 运行该命令
  2. 若出现任何测试失败,必须修复这些问题
  3. 若无法立即修复问题,请停止操作并询问用户下一步怎么做
  4. 只有当所有测试100%通过,或者用户明确允许忽略某些失败时,才视为任务完成

Important Notes

重要说明

  • "Issues" includes not only test failures, but also noise in test output such as warnings which could mask true failures
  • Don't proceed until all tests pass or user explicitly allows deferral
  • Document any failures clearly with file, test name, and error message
  • "问题"不仅包括测试失败,还包括测试输出中的干扰信息,例如可能掩盖真实失败的警告
  • 在所有测试通过或用户明确允许延迟处理前,不要继续进行后续操作
  • 清晰记录所有失败信息,包括文件、测试名称和错误消息

Output

输出结果

Report results organized by:
  1. Passing tests: Summary of what passed
  2. Failing tests: Each failure with file, test name, and error
  3. Recommendations: What needs to be fixed
If all tests pass, simply confirm: "All tests passed."
按以下分类整理并报告结果:
  1. 通过的测试:汇总通过的测试内容
  2. 失败的测试:每个失败项需包含文件、测试名称和错误信息
  3. 建议:需要修复的内容
如果所有测试通过,只需确认:"所有测试通过。"