Browse / Security Testing / Testing Infrastructure

Testing Infrastructure

Implements comprehensive testing infrastructure and patterns for monorepos using Vitest, React Testing Library, and Storybook.

SkillSecurity TestingUnit Testing

The source repository doesn't declare a license. Check its terms before reusing the code.

Key features

  • Best practices for writing accessible, descriptive, and behavior-driven tests.
  • Guidance on unit testing with Vitest and React Testing Library, including query priorities and user interactions.
  • Patterns for interaction testing within Storybook stories using the `play` function.
  • Instructions for running tests locally, debugging failures, and understanding the CI pipeline via the test-suite-runner agent.
  • Strategies for mocking modules, functions, SWR hooks, and APIs using MSW.

Use cases

  • Setting up API mocks or mock data for development and testing.
  • Writing new unit or component tests for a React application.
  • Troubleshooting a failing test in the local environment or CI pipeline.

FAQ

What key testing capabilities does it provide?

It provides guidance on unit testing with Vitest and RTL, interaction testing in Storybook using the `play` function, strategies for mocking modules and SWR hooks, and API mocking with Mock Service Worker (MSW). It also covers debugging and CI processes.

What does the Testing Infrastructure skill do?

This skill equips Claude with the expertise to implement a comprehensive testing framework for monorepos. It provides patterns and code for unit tests with Vitest, component tests with React Testing Library, and interaction tests within Storybook.

When should I use this skill?

Use this skill when you need to write new tests, set up test configurations, mock APIs or modules, debug a failing test, or understand the continuous integration (CI) pipeline. It's your go-to for any testing-related task in the monorepo.

How does this skill improve my workflow?

It accelerates test development by providing instant access to best practices, correct query patterns, and reusable code snippets for mocking. This ensures you write consistent, robust, and maintainable tests without searching through documentation.