patricio0312rev avatar

Integration Test Builder

This builds out complete integration test suites for API endpoints with database interactions. You get test harness scaffolding with setup/teardown, database seeding with Prisma, and full CRUD endpoint tests that verify both HTTP responses and database state. It covers the practical stuff like transaction rollback verification, fixture management, and the arrange/act/assert pattern throughout. Useful when you need to test actual database flows rather than mocking everything out, especially for order processing, user management, or any multi-step operations where you want to confirm the database ended up in the right state. The CI-friendly approach with isolated test databases and automatic cleanup between tests is solid.

skills.sh installs
263
GitHub stars
63
last updated
Aug 21, 2026

Install

$ npx -y skills add patricio0312rev/skills --skill integration-test-builder --agent claude-code

Installs into .claude/skills of the current project.

Files

Integration Test Builder

Build comprehensive integration tests for APIs and database flows.

Test Harness Setup

// tests/setup/test-harness.ts
import { PrismaClient } from "@prisma/client";
import { execSync } from "child_process";

export class TestHarness {
  prisma: PrismaClient;

  async setup() {
    // Setup test database
    process.env.DATABASE_URL = process.env.TEST_DATABASE_URL;

    // Run migrations
    execSync("npx prisma migrate deploy");

    // Initialize Prisma client
    this.prisma = new PrismaClient();

    // Clear all data
    await this.clearDatabase();
  }

  async teardown() {
    await this.prisma.$disconnect();
  }

  async clearDatabase() {
    const tables = await this.prisma.$queryRaw<{ tablename: string }[]>`
      SELECT tablename FROM pg_tables WHERE schemaname = 'public'
    `;

    for (const { tablename } of tables) {
      if (tablename !== "_prisma_migrations") {
        await this.prisma.$executeRawUnsafe(
          `TRUNCATE TABLE "${tablename}" CASCADE`
        );
      }
    }
  }

Sponsors

Details

Repository
github.com/patricio0312rev/skills
Categories
Backend & APIs, Testing & QA, DevOps & CI/CD, Databases
First seen
Jun 3, 2026

More from patricio0312rev/skills

All 138
1patricio0312rev avatarcaching-cdn-strategy-plannerpatricio0312rev/skillsDesigns multi-layer caching strategy with edge CDN, server-side caching, cache invalidation, and CDN configuration. Use for "caching strategy", "CDN setup", "ca258skills.sh installs
2personamanagmentlayer avatarsql-expertpersonamanagmentlayer/pclExpert-level SQL database design, querying, optimization, and administration across PostgreSQL, MySQL, and SQL Server257skills.sh installs
3qodex-ai avatargenerate-swagger-docsqodex-ai/ai-agent-skillsGenerate OpenAPI documentation from source code. Analyzes repository to automatically discover API endpoints and create swagger.json and interactive HTML docume255skills.sh installs
4davila7 avatarshopify-appsdavila7/claude-code-templatesExpert patterns for Shopify app development including Remix/React Router apps, embedded apps with App Bridge, webhook handling, GraphQL Admin API, Polaris compo254skills.sh installs
5novotnyllc avatardotnet-uinovotnyllc/dotnet-artisanBuilds .NET UI apps across Blazor (Server, WASM, Hybrid, Auto), MAUI (XAML, MVVM, Shell, Native AOT), Uno Platform (MVUX, Extensions, Toolkit), WPF (.NET 8+, Fl254skills.sh installs
6phpstan avataranalyse-with-phpstanphpstan/phpstanAnalyse PHP code with PHPStan via the playground API. Tests across all PHP versions (7.2–8.5) and reports errors grouped by version. Supports configuring level,254skills.sh installs