AGENT SKILL
testing
Skill: testing
- License 许可
- MIT
- 最近更新
- 2026-03-22
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- testing
- description
- Skill: testing
03 SKILL.md 正文
Testing Goal
Keep tests in three buckets only:
- Pure unit tests for deterministic logic.
- Thin component or hook contract tests for real app behavior.
- Golden input or output tests when serialized output is the contract.
Hard constraints:
- Prefer Bun for the fast local loop.
- Keep the default suite fast.
- No browser or e2e coverage unless the app behavior truly needs it.
- Coverage is a hotspot tool, not a vanity score.
Core Rules
- Assert public behavior, not implementation detail.
- Keep tests next to the code they cover with
*.spec.ts[x]. - Keep helpers local. Do not import one spec from another.
- Prefer explicit assertions over snapshots.
- Delete skipped, commented, or placeholder tests instead of babysitting them.
Seam Selection
- Use plain function tests for pure logic.
- Use rendered React tests for hooks, components, rerender behavior, and DOM behavior.
- Use browser checks only when the contract is actually browser-specific.
Fixtures And Assertions
- Keep fixtures small.
- Use plain objects for simple state.
- Use
it.eachfor small behavior matrices. - In Bun + Testing Library, prefer render-returned queries over
screen. - Use direct style-property assertions instead of
toHaveStyle. - Use snapshots only when serialized output is the contract and inline assertions would be worse.
Quick Reference
- Keep tests fast and local.
- Start with the smallest seam that proves the behavior.
- Prefer explicit assertions.
- Browser checks are for real UI behavior, not lazy coverage.
04 同仓库更多 Skills
workflows-work
[DEPRECATED] Use /ce:work instead — renamed for clarity.
★ 0
workflows-review
[DEPRECATED] Use /ce:review instead — renamed for clarity.
★ 0
workflows-plan
[DEPRECATED] Use /ce:plan instead — renamed for clarity.
★ 0
workflows-compound
[DEPRECATED] Use /ce:compound instead — renamed for clarity.
★ 0
workflows-brainstorm
[DEPRECATED] Use /ce:brainstorm instead — renamed for clarity.
★ 0
vercel-react-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
★ 0