用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/tomes --skill testing-requirements命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
> Use when this capability is needed.
Use when writing kernel, account, or note MASM code that reads from or writes to the advice provider (advice stack / advice map) — validate advice data.
Use when writing a Rust test that exercises a failure path or a MASM test that expects a `panic` / `assert` — assert on the specific expected error variant or error code.
基于 SOC 职业分类
正在显示 SKILL.md
| name | testing-requirements |
| description | Use when writing tests - test structure, verification steps, coverage goals |
| metadata | {"author":"andyngdz"} |
Use this skill when implementing features that need testing or modifying existing tests.
__tests__/ folder next to source filesComponentName.test.tsx or functionName.test.tsglobal.window.electronAPIbeforeEach)Socket Events - Capture handlers:
let handlers: Record<string, (data: unknown) => void> = {}
vi.mock('@/cores/sockets', () => ({
useSocketEvent: (event, handler) => (handlers[event] = handler)
}))
// Trigger event in test
handlers[SocketEvents.DOWNLOAD_START]({ id: 'model-123' })
Zustand Stores:
import { renderHook, act } from '@testing-library/react'
import { useMyStore } from './useMyStore'
const { result } = renderHook(() => useMyStore())
act(() => result.current.setValue('new'))
React Query:
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
const queryClient = new QueryClient()
const wrapper = ({ children }) => (
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
)
render(<MyComponent />, { wrapper })
pnpm run test:coverage -- path/to/filesBefore marking work complete, ALWAYS run:
pnpm run type-check - TypeScript validationpnpm run lint - ESLint checkspnpm run format - Prettier formattingpnpm test -- path/to/test - Run specific tests❌ Don't test implementation details
socket.on was called 3 times❌ Don't use any type in tests
unknown, or as unknown as Type❌ Don't skip cleanup
beforeEachConverted and distributed by TomeVault — claim your Tome and manage your conversions.