From xonovex-skill-vitest
Provides Vitest 3+ testing guidelines for TypeScript: type safety, HTTP assertions, mocking, snapshots, and CORS preflight tests.
How this skill is triggered — by the user, by Claude, or both
Slash command
/xonovex-skill-vitest:vitest-guideThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- Vitest ≥ 3, TypeScript ≥ 5.8
res.json() to declared interfaces (references/type-safety.md)vi.fn() already returns a Mock; skip casts and generics (references/mock-patterns.md)test/ with nested describe blocks (references/test-organization.md)vi.mock(path) are hoisted to the top of the file — referencing imported variables in the factory throws at hoist timevite-node) differ from Jest — __dirname/__filename work in CommonJS but not ESM tests without polyfillsvi.spyOn returns the spy; vi.fn creates a new mock — confusing them passes type checks but breaks call-tracking assertionsexpect.assertions(n) in async tests catches missed awaits — without it, a forgotten await lets the test pass spuriouslyvitest.config.ts requires a full restart to pick up new transformsres.json() or test variables lose type informationGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
npx claudepluginhub xonovex/platform --plugin xonovex-skill-vitest