testing-test-writing

mshafei721's avatarfrom mshafei721

Write focused, strategic tests for core user flows with behavior-based testing, clear naming, and proper mocking of external dependencies. Use this skill when writing unit tests, integration tests, or end-to-end tests. When working on files in tests/, __tests__/, spec/, or *.test.ts, *.spec.ts files. When deciding what to test during feature development. When naming test cases descriptively. When mocking databases, APIs, or external services. When focusing on testing behavior rather than implementation details.

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 7, 2026

When & Why to Use This Skill

This Claude skill provides expert guidance for writing high-quality, strategic tests. It emphasizes behavior-based testing, descriptive naming conventions, and effective mocking of external dependencies like APIs and databases to ensure robust software quality across unit, integration, and end-to-end testing suites. By focusing on core user flows rather than implementation details, it helps developers maintain a maintainable and reliable codebase.

Use Cases

  • Scenario 1: Writing focused unit, integration, or E2E tests for core user flows during new feature development to ensure functional requirements are met.
  • Scenario 2: Refactoring existing test suites to improve clarity through descriptive naming and shifting the focus from internal implementation to observable behavior.
  • Scenario 3: Implementing proper mocks and stubs for external services, APIs, and databases to isolate units under test and ensure fast, deterministic test execution.
  • Scenario 4: Reviewing and optimizing test code within directories like tests/ or __tests__/ to maintain high standards of software quality and developer feedback loops.
nameTesting Test Writing
descriptionWrite focused, strategic tests for core user flows with behavior-based testing, clear naming, and proper mocking of external dependencies. Use this skill when writing unit tests, integration tests, or end-to-end tests. When working on files in tests/, __tests__/, spec/, or *.test.ts, *.spec.ts files. When deciding what to test during feature development. When naming test cases descriptively. When mocking databases, APIs, or external services. When focusing on testing behavior rather than implementation details.

When to use this skill:

  • When writing new unit, integration, or e2e tests
  • When modifying existing test files
  • When working on files in tests/, tests/, spec/, or test/ directories
  • When working on files like *.test.ts, *.spec.ts, *_test.py, *_spec.rb
  • When deciding what code to test during feature development
  • When choosing to test core user flows vs. edge cases
  • When writing descriptive test names that explain expected outcomes
  • When mocking databases, external APIs, or file systems
  • When isolating units under test from dependencies
  • When ensuring tests focus on behavior, not implementation
  • When reviewing test code for clarity and maintainability
  • When keeping test execution fast for developer feedback

Testing Test Writing

This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle testing test writing.

Instructions

For details, refer to the information provided in this file: testing test writing