gentest
Generates unit tests for code by analyzing source code or file paths, with support for Jest, Vitest, and Mocha frameworks.
Instructions
当用户需要为代码生成单元测试时使用。指南型工具:注入 code/file_path 与测试清单,由 Agent 生成完整测试代码;MCP 不自动生成或运行测试
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | 要生成测试的代码。可以是函数、类或模块 | |
| file_path | No | 要生成测试的源文件路径(相对 project_root 或绝对路径)。未传 code 时从磁盘读取 | |
| framework | No | 测试框架:jest、vitest、mocha。可选,会自动识别项目使用的框架 | |
| project_root | No | 项目根目录绝对路径。配合 file_path 解析相对路径 |