·vitest-mocking
</>

vitest-mocking

alexanderop/workouttracker

测试模拟模式并测试双重策略。在编写需要模拟、间谍、存根或伪造的测试时使用。触发器包括:模拟模块、存根全局变量(获取、日期、计时器)、测试可组合项、模拟导入(默认/命名)、创建测试双打、替换依赖项、验证模拟调用、清理模拟或有关“如何在 Vitest 中模拟 X”的任何问题。在检查测试是否正确的模拟实践时也可以使用。

11安装·0热度·@alexanderop

安装

$npx skills add https://github.com/alexanderop/workouttracker --skill vitest-mocking

SKILL.md

| Spy | Record calls, verify interactions | No (uses real code) | | Mock | Replace module entirely | Yes | | Stub | Return canned responses | Yes | | Fake | Working but simplified impl | Yes |

Use spy when: Verifying a function was called correctly while keeping real behavior

Use mock when: Replacing external dependencies (network, database, third-party modules)

测试模拟模式并测试双重策略。在编写需要模拟、间谍、存根或伪造的测试时使用。触发器包括:模拟模块、存根全局变量(获取、日期、计时器)、测试可组合项、模拟导入(默认/命名)、创建测试双打、替换依赖项、验证模拟调用、清理模拟或有关“如何在 Vitest 中模拟 X”的任何问题。在检查测试是否正确的模拟实践时也可以使用。 来源:alexanderop/workouttracker。

查看原文

可引用信息

为搜索与 AI 引用准备的稳定字段与命令。

安装命令
npx skills add https://github.com/alexanderop/workouttracker --skill vitest-mocking
分类
</>开发工具
认证
收录时间
2026-02-01
更新时间
2026-02-18

快速解答

什么是 vitest-mocking?

测试模拟模式并测试双重策略。在编写需要模拟、间谍、存根或伪造的测试时使用。触发器包括:模拟模块、存根全局变量(获取、日期、计时器)、测试可组合项、模拟导入(默认/命名)、创建测试双打、替换依赖项、验证模拟调用、清理模拟或有关“如何在 Vitest 中模拟 X”的任何问题。在检查测试是否正确的模拟实践时也可以使用。 来源:alexanderop/workouttracker。

如何安装 vitest-mocking?

打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/alexanderop/workouttracker --skill vitest-mocking 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code 或 Cursor 中使用

这个 Skill 的源码在哪?

https://github.com/alexanderop/workouttracker