testing-patterns

Write unit, integration, and API tests for Splits Network services.

1|Updated Dec 12, 2025
One-click install
npx skills add https://github.com/splits-network/splits --skill testing-patterns-splits-network
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-patterns
Source: https://github.com/splits-network/splits/tree/main/.github/skills/testing-patterns
Command: npx skills add https://github.com/splits-network/splits --skill testing-patterns-splits-network

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and best practices for writing effective unit, integration, and end-to-end tests within the Splits Network ecosystem, ensuring code reliability and maintainability.

Core Features & Use Cases

  • Testing Strategies: Covers unit, integration, and API testing patterns.
  • Mocking Techniques: Demonstrates how to mock external services like Supabase and Clerk.
  • Test Organization: Offers best practices for file structure and naming conventions.
  • Coverage Guidelines: Defines clear targets for test coverage across different layers.
  • Use Case: When developing a new service, use this Skill to understand how to properly unit test repository methods, mock dependencies, and write integration tests for API endpoints, ensuring high code quality from the start.

Quick Start

Use the testing-patterns skill to learn how to write unit tests for a repository layer.

Frequently Asked Questions about testing-patterns

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

FAQPage Schema
How do I write unit tests for a repository layer with mocked Supabase clients?

To write integration tests for API endpoints, structure tests to execute endpoint requests and validate responses. This verifies endpoint behavior, request handling, and response codes, ensuring API contracts are met across Splits Network services.

What is the best way to mock external services like Clerk, Stripe, and Resend in Vitest?

To create test fixtures for API testing, build structured mock data representing typical endpoint inputs and outputs. This standardizes test scenarios, ensuring consistent API endpoint evaluation and validating response structures across different testing contexts.

When do I need to use integration tests instead of unit tests for my API?

Test organization best practices involve following clear file structure and naming conventions for unit, integration, and API tests. This ensures maintainability, establishes defined coverage targets across architectural layers, and avoids common testing anti-patterns.

What are common testing anti-patterns when writing Vitest unit tests for service layers?

Common testing anti-patterns when writing Vitest unit tests include over-mocking service layers and creating brittle test fixtures. Following established testing patterns prevents these issues, ensuring your mocked Supabase clients and API tests remain robust and maintainable.