Our review
Provides patterns for unit testing including Vitest configuration, Testing Library component testing, MSW for HTTP mocking, parametrized tests, and async testing.
Strengths
- Emphasizes testing behavior over implementation
- Recommends MSW over jest.mock for network level mocking
- Provides ready-to-use references for common testing scenarios
- Covers both business logic and UI component testing
Limitations
- Assumes familiarity with basic testing concepts
- Examples may not cover every edge case
- Limited to JavaScript/TypeScript ecosystem
Use when setting up a new testing infrastructure or writing unit/component tests for a JavaScript/TypeScript project.
Do not use for end-to-end testing or integration tests that require full system interaction.
Security analysis
SafeThe skill defines unit testing patterns and only uses read-only tools (Read, Grep, Glob). There are no destructive actions, code execution, or data exfiltration.
No concerns found
Examples
Set up Vitest with v8 coverage for my React project.Write a unit test for a pure function that calculates discounts using parametrized tests.Mock an HTTP GET request using MSW for a component test.name: unit-testing description: | Unit testing patterns: Vitest config with v8 coverage, Testing Library behavior testing, MSW for HTTP mocking (vs jest.mock), it.each parametrized tests, spies vs mocks vs stubs, testing async code, snapshot testing guidelines. Use when writing unit and component tests. allowed-tools: Read, Grep, Glob
Unit Testing Patterns
When to use
- Setting up Vitest or Jest for a new project
- Writing unit tests for business logic
- Component testing with Testing Library
- Mocking HTTP requests with MSW
- Parametrized tests with it.each
Core principles
- Test behavior, not implementation — what does it return/do, not how
- MSW over jest.mock — mock at network level, not module level
- One assertion per test — single reason to fail per test
- Arrange-Act-Assert — consistent structure in every test
- No test interdependence — each test must run independently
References available
references/vitest-config.md— globals, environment, coverage thresholds, thread pool, MSW setupreferences/business-logic-testing.md— pure function tests, AAA pattern, it.each parametrized testsreferences/msw-http-mocking.md— handlers setup, server lifecycle, per-test handler overridesreferences/async-testing.md— await patterns, rejected promise assertions, try/catch error checksreferences/testing-library-react.md— render, screen queries, userEvent vs fireEvent, role queries
TDD Red-Green-Refactor
Testing
Skill that guides Claude through the complete TDD cycle.
Web Accessibility Audit
Testing
Performs a comprehensive web accessibility audit following WCAG standards.
UAT Test Case Generator
Testing
Generates structured and comprehensive user acceptance test cases.