unit-testing-patterns
Unit Testing Patterns
Comprehensive patterns for writing effective, maintainable unit tests following TDD principles.
Test-Driven Development (TDD)
The TDD Cycle
- Red - Write a failing test first
- Green - Write minimal code to pass the test
- Refactor - Improve code while keeping tests green
// Step 1: RED - Write failing test
describe('Calculator', () => {
it('should add two numbers', () => {
const calc = new Calculator();
expect(calc.add(2, 3)).toBe(5);
});
More from karchtho/my-claude-marketplace
ui-ux-design
UI/UX design principles, design systems, accessibility, responsive design, and user experience best practices. Activates when discussing layouts, styling, design decisions, user flows, or visual design.
12nginx-configuration
Configure Nginx web server for high-performance reverse proxy, load balancing, SSL/TLS, caching, and API gateway functionality. Master production deployments, security headers, and monitoring.
11docker-compose-creator
Design multi-container applications with Docker Compose. Covers service orchestration, networking, volumes, environment configuration, health checks, and production deployment patterns. Use when defining local development stacks or deploying multi-service applications.
10dockerfile-generator
Generate production-ready Dockerfiles with best practices for various tech stacks. Covers multi-stage builds, optimization, security, and language-specific patterns (Node.js, Python, Go, Rust, Java). Use when creating new application containers.
8docker-container-basics
Docker containerization fundamentals. Master container lifecycle, image management, networking, volumes, resource limits, and production deployment patterns. Use when building, running, debugging containers or implementing container orchestration.
8feature-architect
Design game feature architecture before writing code. Use when planning a new feature system, deciding on component structure, or mapping out how a feature integrates with existing systems.
6