jpskill.com
💼 ビジネス コミュニティ

integration-testing

Design and implement integration tests that verify component interactions, API endpoints, database operations, and external service communication. Use for integration test, API test, end-to-end component testing, and service layer validation.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o integration-testing.zip https://jpskill.com/download/21450.zip && unzip -o integration-testing.zip && rm integration-testing.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/21450.zip -OutFile "$d\integration-testing.zip"; Expand-Archive "$d\integration-testing.zip" -DestinationPath $d -Force; ri "$d\integration-testing.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して integration-testing.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → integration-testing フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
6

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

結合テスト

目次

概要

結合テストは、異なるコンポーネント、モジュール、またはサービスが連携して正しく機能することを確認します。単一の関数を分離する単体テストとは異なり、結合テストはデータベース、API、外部サービス、インフラストラクチャなど、システムの複数の部分間の相互作用を検証します。

使用するタイミング

  • 実際のデータベース接続を使用したAPIエンドポイントのテスト
  • サービス間の通信の検証
  • 複数のレイヤーにわたるデータフローの検証
  • 実際のデータベースを使用したリポジトリ/DAOレイヤーのテスト
  • 認証および認可フローの確認
  • メッセージキューのコンシューマーとプロデューサーの検証
  • サードパーティサービス統合のテスト

クイックスタート

最小限の動作例:

// 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: "test@example.com",
        name: "Test User",
        password: "SecurePass123!",
      };
// ... (see reference guides for full implementation)

リファレンスガイド

references/ ディレクトリ内の詳細な実装:

ガイド 内容
API Integration Testing API結合テスト
Database Integration Testing データベース結合テスト
External Service Integration 外部サービス統合
Message Queue Integration メッセージキュー統合

ベストプラクティス

✅ DO

  • 結合テストでは実際のデータベースを使用する(インメモリまたはコンテナ)
  • モックされたレスポンスではなく、実際のHTTPリクエストをテストする
  • 操作後のデータベースの状態を検証する
  • トランザクション境界とロールバックをテストする
  • テストに認証/認可を含める
  • エラーシナリオとエッジケースをテストする
  • 隔離された環境のためにテストコンテナを使用する
  • テスト間でデータをクリーンアップする

❌ DON'T

  • 結合テストでデータベース接続をモックする
  • エラーパスのテストをスキップする
  • テストデータをデータベースに残す
  • テストに本番データベースを使用する
  • トランザクション管理を無視する
  • ハッピーパスのみをテストする
  • テスト間で状態を共有する
  • URLや認証情報をハードコードする
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

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: "test@example.com",
        name: "Test User",
        password: "SecurePass123!",
      };
// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

Guide Contents
API Integration Testing API Integration Testing
Database Integration Testing Database Integration Testing
External Service Integration External Service Integration
Message Queue Integration Message 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

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。