testing-patterns

Standardize Jest testing practices for Ree-board projects with structured layouts and mocking strategies.

1|1|Updated Jul 21, 2024
One-click install
npx skills add https://github.com/DW225/ree-board --skill testing-patterns-dw225
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-patterns
Source: https://github.com/DW225/ree-board/tree/main/.claude/skills/testing-patterns
Command: npx skills add https://github.com/DW225/ree-board --skill testing-patterns-dw225

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Standardizes and codifies Jest testing practices for Ree-board projects, reducing drift and accelerating onboarding by providing clear patterns and examples.

Core Features & Use Cases

  • Test Organization: recommended directory layout and naming conventions for unit, integration, and E2E tests.
  • Factory Patterns: reusable test data builders to generate deterministic data for tests.
  • Mocking Strategies: examples for mocking authentication, external services, and real-time dependencies.
  • Real-time Testing: patterns for testing live message processors and event streams with fake timers.
  • Test-Driven Workflows: guidance for TDD, refactoring, and maintaining high test quality across code bases.

Quick Start

Create tests following these patterns and run pnpm test to validate them.

Frequently Asked Questions about testing-patterns

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

FAQPage Schema
How do I standardize Jest testing patterns for consistency across my projects?

Standardize Jest testing patterns by codifying test organization, data factories, and mocking strategies to eliminate ad-hoc testing. This enforces structured layouts, fake timers, and explicit anti-pattern guidance for consistent test quality.

What's the best way to mock external services and authentication in Jest tests?

Mock external services and authentication in Jest tests using comprehensive mocking strategies. Standardized patterns provide examples for mocking real-time dependencies and external service calls to ensure deterministic test execution.

How do I test real-time message processors and event streams with Jest?

Test real-time message processors and event streams with Jest by applying fake timers. Standardized testing patterns provide specific guidance for testing live message processors and event streams to handle asynchronous behavior reliably.

How do I structure unit, integration, and E2E test directories for consistency?

Structure unit, integration, and E2E test directories by following recommended directory layouts and naming conventions. Standardized test organization eliminates drift and accelerates onboarding with clear patterns.

Can I use test-driven development workflows with server actions and UI components?

Yes, you can use test-driven development workflows with server actions and UI components. Standardized patterns provide TDD guidance for refactoring and maintaining high test quality across both server actions and UI components.

Why should I use factory patterns for generating test data in Jest?

Use factory patterns to generate deterministic test data in Jest by creating reusable test data builders. This ensures consistent data generation across tests and reduces drift by providing clear, repeatable data patterns.