testing-patterns

Codify Vitest testing conventions for TypeScript unit and integration tests.

28|23|Updated Sep 14, 2023
One-click install
npx skills add https://github.com/leather-io/mono --skill testing-patterns-leather-io
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-patterns
Source: https://github.com/leather-io/mono/tree/main/.claude/skills/testing-patterns
Command: npx skills add https://github.com/leather-io/mono --skill testing-patterns-leather-io

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Leather monorepo lacks a unified set of testing conventions; this skill codifies Vitest patterns to ensure consistent, readable, and maintainable tests across projects.

Core Features & Use Cases

  • Co-located tests with source files to simplify navigation and refactoring.
  • Clear naming conventions, fixture usage, and test structure to improve readability and reliability.
  • Use cases include unit testing, integration testing, and test fixtures creation for new modules.

Quick Start

To start applying these patterns, begin by organizing your tests alongside their source files and following the Vitest naming conventions described above.

Frequently Asked Questions about testing-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure Vitest unit tests in a TypeScript monorepo?

Structure Vitest unit tests in a TypeScript monorepo by co-locating test files alongside source code, applying clear naming conventions, and utilizing shared fixtures to ensure consistency and readability. This simplifies navigation and refactoring.

What are the best Vitest conventions for organizing test fixtures?

The best Vitest conventions for organizing test fixtures involve defining shared fixtures centrally and co-locating tests with source files. This standardizes testing practices, improves reliability, and maintains readability across monorepo projects.

Can I use these Vitest testing patterns for integration tests?

Yes, you can use these Vitest testing patterns for integration tests. The conventions standardize both unit and integration testing by defining file naming, test structure, fixture usage, and Vitest setup for TypeScript projects.

Why should I co-locate test files with source files in Vitest?

You should co-locate test files with source files in Vitest to simplify navigation and refactoring. This testing structure ensures developers can quickly find and update tests alongside related code, improving overall maintainability.

Does this skill define Vitest setup and configuration standards?

Yes, this skill defines Vitest setup and configuration standards. It codifies specific conventions for file naming, test structure, fixture usage, and setup that developers must follow to standardize testing practices across projects.