mock-generation

Community

Automate test mocks and stubs for reliable tests.

AuthorProtagonistss
Version1.0.0
Installs0

System Documentation

What problem does it solve?

生成测试所需的Mock数据与Stub函数,帮助隔离测试环境并提高测试效率。

Core Features & Use Cases

  • 依赖分析:自动识别需要Mock的外部依赖,分析函数签名和返回值类型,检测数据库操作、API调用等外部交互,识别时间和随机等不可控因素。
  • Mock数据生成:生成符合类型定义的Mock对象,创建真实的测试数据集,支持复杂嵌套对象的生成,生成边界值和异常数据。
  • Stub函数创建:创建可控的函数替代品,支持多种返回值模式,记录调用历史和参数,模拟异步操作。

Quick Start

运行 mock 生成工作流,为你的模块自动生成 Mock 数据和 Stub 函数,以提升测试可重复性和可维护性。

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: mock-generation
Download link: https://github.com/Protagonistss/ithinku-plugins/archive/main.zip#mock-generation

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.