prowler-cloud/prowler/vitest
Claude Code and agent skill by prowler-cloud/prowler
Trust tier 2
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Vitest 4 unit and browser-integration testing patterns with React Testing Library (Prowler UI). Trigger: When writing Vitest tests (*.test.ts(x) or *.integration.test.tsx) for React components, hooks, utilities, stores or server actions.
Install
npx vskill@latest install prowler-cloud/prowler/vitestSKILL.md
For E2E tests: Useprowler-test-uiskill (Playwright).This skill covers unit/integration tests with Vitest + React Testing Library.
Prowler UI Test Projects (ui/vitest.config.ts)
| Project | Files | Environment | Setup | |
|---|---|---|---|---|
unit | **/*.test.{ts,tsx} (excludes tests/**, *.integration.test.*) | jsdom, no React Compiler | vitest.setup.ts (jest-dom matchers, storage mock) | |
integration | **/*.integration.test.{ts,tsx} | Vitest browser mode, Playwright Chromium, React Compiler | vitest.integration.setup.ts (MSW worker, globals.css, mocks for @/auth.config, next/cache, server-only) |
- Tests are co-located next to the code (
foo.ts->foo.test.ts); shared fixtures live inui/__tests__/. - Config sets
globals,restoreMocks,mockReset,unstubEnvs,unstubGlobals: do not addafterEach(vi.restoreAllMocks)boilerplate. - Integration tests import
page/userEventfromvitest/browser, render with@/__tests__/render-browser, and mock HTTP with MSW (ui/__tests__/msw/), notvi.mockof fetch.
Test Structure (REQUIRED)
Use Given/When/Then (AAA) pattern with comments:
Describe Block Organization
Group by behavior, NOT by method.
Query Priority (REQUIRED)
| Priority | Query | Use Case | |
|---|---|---|---|
| 1 | getByRole | Buttons, inputs, headings | |
| 2 | getByLabelText | Form fields | |
| 3 | getByPlaceholderText | Inputs without label | |
| 4 | getByText | Static text | |
| 5 | getByTestId | Last resort only |
userEvent over fireEvent (REQUIRED)
Async Testing Patterns
Mocking
vi.spyOn vs vi.mock
| Method | When to Use | |
|---|---|---|
vi.spyOn | Observe or override one export/method | |
vi.mock | Replace a module boundary (server actions, next/navigation, next-auth) |
Common Matchers
What NOT to Test
Commands
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/vitest/SKILL.md
Popularity
- Repository stars
- 13,758
- Repository forks
- 2,119
- 7-day trend score
- 48
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 9 May 2026, 6 months ago.
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/prowler-cloud/prowler/vitest)