Covers HTTP API testing with Supertest for TypeScript and httpx/pytest for Python. You get practical patterns for REST and GraphQL endpoints, including auth flows, file uploads, request/response validation, and error handling. The examples are solid: shows how to set up fixtures, test protected routes with bearer tokens, validate response timing, and handle common edge cases like 404s and validation errors. The TypeScript side assumes you're using Vitest for your test runner. What's nice is it doesn't overthink things. Just straightforward test patterns you can copy and adapt without wading through theory about testing pyramids or mocking philosophies.

skills.sh installs
910
GitHub stars
248
last updated
Aug 21, 2026

Install

$ npx -y skills add secondsky/claude-skills --skill api-testing --agent claude-code

Installs into .claude/skills of the current project.

Files

API Testing

Expert knowledge for testing HTTP APIs with Supertest (TypeScript/JavaScript) and httpx/pytest (Python).

TypeScript/JavaScript (Supertest)

Installation

# Using Bun
bun add -d supertest @types/supertest

# or: npm install -D supertest @types/supertest

Basic Setup

import { describe, it, expect } from 'vitest'
import request from 'supertest'
import { app } from './app'

describe('API Tests', () => {
  it('returns health status', async () => {
    const response = await request(app)
      .get('/api/health')
      .expect(200)

    expect(response.body).toEqual({ status: 'ok' })
  })

  it('creates a user', async () => {
    const response = await request(app)
      .post('/api/users')
      .send({ name: 'John Doe', email: 'john@example.com' })
      .expect(201)

    expect(response.body).toMatchObject({
      id: expect.any(Number),
      name: 'John Doe',
    })
  })

  it('validates required fields', async () => {
    await request(app)
      .post('/api/users')
      .send({ name: 'John Doe' })
      .expect(400)
  })
})

Request Methods

// GET
await request(app).get('/api/users').expect(200)

Sponsors

Details

Repository
github.com/secondsky/claude-skills
Categories
Backend & APIs, Testing & QA, Security, Debugging, Python
First seen
Jun 3, 2026

More from secondsky/claude-skills

All 146
1tencentcloudbase avatarrelational-database-web-cloudbasetencentcloudbase/skills[Deprecated] Use when building frontend Web apps that talk to CloudBase Relational Database via @cloudbase/js-sdk – provides the canonical init pattern so you c901skills.sh installs
2moizibnyousaf avatarbackend-developmentmoizibnyousaf/ai-agent-skillsBackend API design, database architecture, microservices patterns, and test-driven development. Use for designing APIs, database schemas, or backend system arch874skills.sh installs
3railwayapp avatardatabaserailwayapp/railway-skillsThis skill should be used when the user wants to add a database (Postgres, Redis, MySQL, MongoDB), says "add postgres", "add redis", "add database", "connect to872skills.sh installs
4aj-geddes avatarapi-security-hardeningaj-geddes/useful-ai-promptsSecure REST APIs with authentication, rate limiting, CORS, input validation, and security middleware. Use when building or hardening API endpoints against commo868skills.sh installs
5encoredev avatarencore-authencoredev/skillsProtect Encore.ts endpoints with authentication and authorize callers. Covers `authHandler`, `Gateway`, `getAuthData`, and `auth: true`.864skills.sh installs
6docyrus avatardocyrus-api-devdocyrus/agent-skillsDevelop applications using the Docyrus API with @docyrus/api-client and @docyrus/signin libraries. Use when building apps that authenticate with Docyrus OAuth2 847skills.sh installs