integration-test

Generate Jest and TypeScript integration tests for backend API routes and database operations.

4|1|Updated Sep 21, 2025
One-click install
npx skills add https://github.com/xmark168/VibeSDLC --skill integration-test-xmark168
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: integration-test
Source: https://github.com/xmark168/VibeSDLC/tree/main/backend/app/agents/tester/src/skills/nextjs/integration-test
Command: npx skills add https://github.com/xmark168/VibeSDLC --skill integration-test-xmark168

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill streamlines the process of writing comprehensive integration tests for your backend API routes and database operations, ensuring code quality and reliability.

Core Features & Use Cases

  • API Endpoint Testing: Write tests for GET, POST, PUT, DELETE requests.
  • Database Interaction Testing: Mock and verify interactions with your database (e.g., Prisma).
  • Branch Coverage Focus: Guides you to write minimal, effective tests that achieve high branch coverage.
  • Use Case: After developing a new API endpoint for user creation, use this Skill to write integration tests that verify successful user creation, handle invalid input, and confirm database persistence.

Quick Start

Use the integration-test skill to write a Jest test for the POST /api/users endpoint.

Frequently Asked Questions about integration-test

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

FAQPage Schema
How do I write integration tests for API routes using Jest and TypeScript?

Integration tests for API routes using Jest and TypeScript are generated by following a 3-4 test strategy per API endpoint. This approach emphasizes branch coverage, flexible assertions, and avoids hardcoded values to ensure robust backend testing.

What's the best way to test Prisma database interactions in a backend integration test?

Testing Prisma database interactions in a backend integration test is handled by strictly adhering to project-defined mocking patterns. This verifies database persistence and interactions without relying on actual database state during the Jest test execution.

How many integration tests do I need per API endpoint for high branch coverage?

A 3-4 test strategy per API endpoint is recommended to achieve high branch coverage. This minimal yet effective approach verifies successful operations, handles invalid input, and confirms database persistence without creating redundant test cases.

Can I use this approach to test NextAuth and external API integrations?

Yes, testing NextAuth and external API integrations is supported by following strictly defined mocking patterns. The generated integration tests mock these external services to isolate and verify your backend API route logic effectively.

Does integration testing require hardcoded values for API response assertions?

No, integration testing avoids hardcoded values by emphasizing flexible assertions. This practice ensures that tests remain robust and do not break from minor data changes, focusing instead on verifying the correct API behavior and database state.