unit-test-mocking
星标2
分支0
更新时间2026年4月8日 05:49
Mocking patterns for Vitest unit tests. Read this only when mocking is required.
安装
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
文件资源管理器
3 个文件SKILL.md
readonly菜单
Mocking patterns for Vitest unit tests. Read this only when mocking is required.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Create or update custom React hooks with clear API design, TypeScript-friendly patterns, and test-first workflow. Use when the user asks to make/build/create/modify a custom hook, refactor hook logic, or add/update hook tests.
Write and maintain unit tests with Vitest. Test titles MUST be English `it('should ...')` strings. Use when adding or updating unit tests, improving test coverage, or handling unavoidable coverage gaps with documented ignore comments.
Basic Vitest module mocking pattern with vi.mock.
Keep real exports and override only selected functions in Vitest.
基于 SOC 职业分类
| name | unit-test-mocking |
| description | Mocking patterns for Vitest unit tests. Read this only when mocking is required. |
vi.clearAllMocks(), vi.restoreAllMocks(), or reset modules as needed for dynamic import patterns../module-mocking/SKILL.md./module-mocking-with-actual-exports/SKILL.md