integration-testing

Test Node.js API endpoints with Vitest and Supertest.

2|1|Updated Nov 13, 2025
One-click install
npx skills add https://github.com/MolcajeteAI/plugin --skill integration-testing-molcajeteai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: integration-testing
Source: https://github.com/MolcajeteAI/plugin/tree/main/deprecated/tech-stacks/js/node/skills/integration-testing
Command: npx skills add https://github.com/MolcajeteAI/plugin --skill integration-testing-molcajeteai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires vitest, supertest, @types/supertest, fastify, @prisma/client, bcrypt, jsonwebtoken, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of testing API endpoints, ensuring that your application's backend functions correctly and reliably under various conditions.

Core Features & Use Cases

  • API Endpoint Testing: Verify the functionality of your API routes, including CRUD operations and authentication flows.
  • Request/Response Validation: Assert that API requests are processed correctly and that responses match expected formats and data.
  • Database Interaction Testing: Ensure that API actions correctly interact with your database, including data creation, updates, and deletions.
  • Use Case: You've just implemented a new user registration API endpoint. Use this Skill to write tests that confirm a user can be created with valid data, reject requests with invalid email formats, and prevent duplicate email registrations.

Quick Start

Use the integration-testing skill to write tests for the user API endpoints.

Frequently Asked Questions about integration-testing

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

FAQPage Schema
How do I test API endpoints with Vitest and Supertest in Node.js?

API integration testing with Vitest and Supertest involves sending HTTP requests to your Node.js endpoints and asserting that request and response validation, database interactions, and authentication flows function correctly. You configure test environments and seed data to verify backend reliability.

Can I test database interactions and authentication flows using Supertest?

Yes, testing database interactions and authentication flows with Supertest is fully supported. You can verify CRUD operations triggered by API requests and validate secure endpoints by utilizing dependencies like Prisma Client, bcrypt, and jsonwebtoken within your Vitest test environments.

Does Vitest integration testing work with Fastify and Prisma?

Vitest integration testing works effectively with Fastify and Prisma. The setup requires configuring your Vitest environment to initialize the Fastify server and manage Prisma Client database state, enabling comprehensive validation of your backend routes and data persistence.

What's the best way to validate request and response formats in backend testing?

The best way to validate request and response formats in backend testing is using Supertest with Vitest. It asserts that API requests are processed correctly and that responses match expected data structures, covering routes, CRUD operations, and error handling.

Do I need to set up data seeding for API integration testing?

Yes, data seeding is required for comprehensive API integration testing. Setting up data seeding in your Vitest configuration ensures your database has the necessary initial state to accurately validate request and response behavior and prevent duplicate data issues.