什么是 write-tests?
使用正确的模拟模式将测试覆盖率添加到现有代码中。在向未经测试的模块添加测试、为错误编写回归测试或用户要求测试特定文件时使用。处理mockReset:true、vi.hoisted()、转发模式和测试应用程序构建器实用程序。 来源:acedergren/agentic-tools。
使用正确的模拟模式将测试覆盖率添加到现有代码中。在向未经测试的模块添加测试、为错误编写回归测试或用户要求测试特定文件时使用。处理mockReset:true、vi.hoisted()、转发模式和测试应用程序构建器实用程序。
通过命令行快速安装 write-tests AI 技能到你的开发环境
来源:acedergren/agentic-tools。
| Route handler | Test app builder + session simulation + app.inject() | | Repository | Mock DB connection + counter-based execute | | Framework plugin | Real framework instance + selective dependency mocks | | Pure utility | No mocks — test inputs/outputs directly | | Service w/ DI | Mock injected deps via forwarding pattern |
If your test runner uses mockReset: true, most examples from the internet will silently fail.
For complex TDZ cases (multiple interdependent mocks), use the globalThis registry pattern.
使用正确的模拟模式将测试覆盖率添加到现有代码中。在向未经测试的模块添加测试、为错误编写回归测试或用户要求测试特定文件时使用。处理mockReset:true、vi.hoisted()、转发模式和测试应用程序构建器实用程序。 来源:acedergren/agentic-tools。
为搜索与 AI 引用准备的稳定字段与命令。
npx skills add https://github.com/acedergren/agentic-tools --skill write-tests使用正确的模拟模式将测试覆盖率添加到现有代码中。在向未经测试的模块添加测试、为错误编写回归测试或用户要求测试特定文件时使用。处理mockReset:true、vi.hoisted()、转发模式和测试应用程序构建器实用程序。 来源:acedergren/agentic-tools。
打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/acedergren/agentic-tools --skill write-tests 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用
https://github.com/acedergren/agentic-tools