mcpField
I
integration-testing

integration-testing

github.com/aj-geddesTesting & quality373553 installsUpdated 34w ago
Repository

About integration-testing

An integration-testing skill for developers validating interactions among application components and external systems. It focuses on real connections such as databases, APIs, and message queues rather than isolated unit tests.

Key features

  1. 01API and database integration tests
  2. 02Service communication validation
  3. 03Data-flow testing across layers
  4. 04Authentication flow testing
  5. 05Message queue integration tests

Use cases

  1. 01Testing APIs against a real database
  2. 02Checking service-to-service communication
  3. 03Validating authentication and authorization
  4. 04Testing third-party service integrations

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill integration-testing

After installing, type/integration-testingin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
api-integration-testing.md
database-integration-testing.md
external-service-integration.md
message-queue-integration.md
scripts/
scaffold-tests.sh
templates/
test-template.js

Details

From the project README

Integration Testing

Table of Contents

Overview

Integration testing validates that different components, modules, or services work correctly together. Unlike unit tests that isolate single functions, integration tests verify the interactions between multiple parts of your system including databases, APIs, external services, and infrastructure.

When to Use

  • Testing API endpoints with real database connections
  • Verifying service-to-service communication
  • Validating data flow across multiple layers
  • Testing repository/DAO layer with actual databases
  • Checking authentication and authorization flows
  • Verifying message queue consumers and producers
  • Testing third-party service integrations

Quick Start

Minimal working example:

// test/api/users.integration.test.js
const request = require("supertest");
const app = require("../../src/app");
const { setupTestDB, teardownTestDB } = require("../helpers/db");

describe("User API Integration Tests", () => {
  beforeAll(async () => {
    await setupTestDB();
  });

  afterAll(async () => {
    await teardownTestDB();
  });

  beforeEach(async () => {
    await clearUsers();
  });

  describe("POST /api/users", () => {
    it("should create a new user with valid data", async () => {
      const userData = {
        email: "[email protected]",
        name: "Test User",
        password: "SecurePass123!",
      };
// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
API Integration TestingAPI Integration Testing
Database Integration TestingDatabase Integration Testing
External Service IntegrationExternal Service Integration
Message Queue IntegrationMessage Queue Integration

Best Practices

✅ DO
  • Use real databases in integration tests (in-memory or containers)
  • Test actual HTTP requests, not mocked responses
  • Verify database state after operations
  • Test transaction boundaries and rollbacks
  • Include authentication/authorization in tests
  • Test error scenarios and edge cases
  • Use test containers for isolated environments
  • Clean up data between tests
❌ DON'T
  • Mock database connections in integration tests
  • Skip testing error paths
  • Leave test data in databases
  • Use production databases for testing
  • Ignore transaction management
  • Test only happy paths
  • Share state between tests
  • Hardcode URLs or credentials

Comments

Markdown supported