Use describe blocks to group related tests logically
Prefer async/await for handling asynchronous code
Use beforeEach and afterEach hooks for setup/teardown
Mock external dependencies to isolate test subjects
Utilize Vitest's snapshot testing for UI components
Leverage Vitest's built-in assertions for clarity
Configure Vitest to run specific test files or directories
Use .only and .skip to focus on specific tests
Integrate Vitest seamlessly with version control hooks
Maintain a separate vitest.config.js for test-specific configuration
Quality Checklist
All tests should be deterministic and stable
Ensure high coverage with meaningful tests
Avoid testing implementation details; focus on behavior
Provide clear and descriptive test names
Regularly refactor tests to remove duplication
Continuously review and update mocks and stubs
Optimize test run times without sacrificing coverage
Consistently review and prune outdated tests
Ensure compatibility with multiple Node.js versions
Document test rationale and methodology clearly
Output
A comprehensive suite of tests covering all critical paths
Structured test files with logical organization
Detailed test reports with coverage metrics
Maintained and updated vitest snapshots
Clean test directory with no orphan or obsolete files
Documented test cases with clear descriptions
Efficient execution with minimal global side effects
Configuration files for customizing test environments
Established CI/CD workflows for automated testing
Secure and isolated testing environments for reliability
1---2name: vitest-expert3description: Use when implementing vitest functionality with production-grade patterns and safeguards.4metadata:5 hermes:6 tags: [codex-agent, general]7 source: https://skillmd.com/skills/0xharryriddle/vitest-expert8 upstream: codex-field-kit/general9---1011# Vitest Expert1213## Focus Areas1415- Mastery of Vitest API and configuration16- Writing unit tests for JavaScript and TypeScript17- Asynchronous test handling and assertions18- Mocking and spying on modules and functions19- Test setup and teardown with hooks20- Grouping and organizing related tests21- Handling test environments and global variables22- Configuring Vitest for different environments23- Integrating Vitest with CI/CD pipelines24- Debugging tests effectively within Vitest2526## Approach2728- Use `describe` blocks to group related tests logically29- Prefer `async/await` for handling asynchronous code30- Use `beforeEach` and `afterEach` hooks for setup/teardown31- Mock external dependencies to isolate test subjects32- Utilize Vitest's snapshot testing for UI components33- Leverage Vitest's built-in assertions for clarity34- Configure Vitest to run specific test files or directories35- Use `.only` and `.skip` to focus on specific tests36- Integrate Vitest seamlessly with version control hooks37- Maintain a separate vitest.config.js for test-specific configuration3839## Quality Checklist4041- All tests should be deterministic and stable42- Ensure high coverage with meaningful tests43- Avoid testing implementation details; focus on behavior44- Provide clear and descriptive test names45- Regularly refactor tests to remove duplication46- Continuously review and update mocks and stubs47- Optimize test run times without sacrificing coverage48- Consistently review and prune outdated tests49- Ensure compatibility with multiple Node.js versions50- Document test rationale and methodology clearly5152## Output5354- A comprehensive suite of tests covering all critical paths55- Structured test files with logical organization56- Detailed test reports with coverage metrics57- Maintained and updated vitest snapshots58- Clean test directory with no orphan or obsolete files59- Documented test cases with clear descriptions60- Efficient execution with minimal global side effects61- Configuration files for customizing test environments62- Established CI/CD workflows for automated testing63- Secure and isolated testing environments for reliability64
Run npx get-skill add 0xharryriddle/vitest-expert in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Use when implementing vitest functionality with production-grade patterns and safeguards. It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. Capability flags: docs only. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
0xharryriddle (@0xharryriddle) published this skill. Their other Agent Skills are listed on their SkillMD profile.