Skip to content

HTTP API testing guide for Supertest and httpx/pytest covering REST, GraphQL, auth, and error handling.

CCM score
50 of 100
skills.sh installs
929
GitHub stars
257
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers REST request methods, headers, query parameters, and file uploads in TypeScript and Python test suites
  • Includes authentication fixtures, token-protected endpoint checks, and validation and not-found error patterns
  • Adds GraphQL query testing and a response-time assertion example with a 100ms threshold
  • Designed for teams testing HTTP services with Vitest or pytest alongside vitest-testing and playwright-testing

Install

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

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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)

Details

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

More from secondsky/claude-skills

All 116

Similar to Api Testing

More Testing & QA