gabrielmoreira/agent-skills-mirror/ng22-vitest
Claude Code and agent skill by gabrielmoreira/agent-skills-mirror
Trust tier 3
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending
Checking that the SKILL.md file is still in the repository.
Guides Angular 22 teams to use Vitest for fast, deterministic unit and component testing.
Install
npx vskill@latest install gabrielmoreira/agent-skills-mirror/ng22-vitestSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as gabrielmoreira/agent-skills-mirror/ng22-vitest.
Angular 22 Vitest Testing
Use Vitest for fast feedback loops, deterministic assertions, and lightweight component and service tests. Keep test setup minimal and focus on observable behavior.
Core Rules
- Prefer Vitest for unit tests that do not need a full browser runtime.
- Keep test files colocated with the code they verify when that improves discoverability.
- Mock only external boundaries such as HTTP, storage, timers, and browser globals.
- Use
describe,it,expect,vi, and lifecycle hooks consistently. - Favor stable assertions over snapshot-heavy workflows unless snapshots are truly valuable.
- Use
vitest runfor one-shot CI execution and the watch runner for local iteration.
Example
Async and Timers
Configuration Guidance
- Vitest reads
vite.config.*by default, so reuse existing Vite configuration when possible. - Use a dedicated
vitest.config.*when test-specific settings need to stay separate. - Keep setup files small and predictable.
- Use browser mode only when a test depends on real browser APIs or visual behavior.
Testing Style
- Prefer explicit arrange, act, assert structure.
- Keep assertions close to the behavior that matters.
- Use
vi.mock()sparingly and reset mocks between tests. - Use snapshots only when the output is stable and structural change matters.
- Use
test.eachordescribe.eachwhen coverage varies only by input data.
Best Practices
- Reset spies and mocks between tests to avoid shared state.
- Keep async tests explicit by awaiting the observable result.
- Prefer fake timers for predictable time-based logic.
- Use component tests only for rendered behavior that matters to users.
Review Checklist
- The test name says what changes if the assertion fails.
- The setup is minimal and local.
- The test runner choice matches the test's risk and scope.
- Mocks do not hide important integration behavior.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingmirrors/repos/PavanAnguluri@angular22-agent-skills/skills/ng22-vitest/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/gabrielmoreira/agent-skills-mirror/ng22-vitest)