api-testing

Test API endpoints with Supertest, MSW, and Zod validation.

14|5|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/oakoss/agent-skills --skill api-testing-oakoss
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-testing
Source: https://github.com/oakoss/agent-skills/tree/main/skills/api-testing
Command: npx skills add https://github.com/oakoss/agent-skills --skill api-testing-oakoss

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill streamlines the process of testing your API endpoints, ensuring they function correctly and reliably under various conditions.

Core Features & Use Cases

  • Integration Testing: Validate API endpoints using Supertest against Express, Fastify, and Hono applications.
  • HTTP Mocking: Mock external API requests with Mock Service Worker (MSW) for isolated and predictable testing.
  • Schema Validation: Ensure API responses adhere to expected structures using Zod.
  • Use Case: When developing a new user registration endpoint, use this Skill to write tests that verify successful creation, handle invalid input gracefully, and mock any dependent services like email verification.

Quick Start

Write integration tests for your API endpoints using Supertest and MSW.

Frequently Asked Questions about api-testing

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

FAQPage Schema
How do I write integration tests for API endpoints using Supertest?

You can write integration tests for API endpoints using Supertest to validate REST applications built with Express, Fastify, or Hono. It enables direct HTTP requests against your routes to verify response status codes and payloads.

What is the best way to mock external API requests during testing?

Mocking external API requests during testing is best handled with Mock Service Worker (MSW). It intercepts network requests at the service worker level, providing isolated and predictable HTTP mocking for your integration tests.

How do I validate API response schemas with Zod?

You validate API response schemas with Zod by defining expected data structures and asserting HTTP responses against them. This ensures your REST API endpoints consistently return correctly typed data under various conditions.

Does this API testing approach work with Fastify and Hono frameworks?

Yes, this API testing approach works with Fastify and Hono frameworks, alongside Express. Supertest is utilized to perform integration testing directly against applications built with these specific web frameworks.

How do I test invalid input handling for a REST API endpoint?

To test invalid input handling for a REST API endpoint, you write integration tests that send malformed data via Supertest and use Zod schema validation to assert that the API responds gracefully with appropriate error structures.