API Testing Essentials
Test every layer of your API from the ground up — happy-path CRUD with Supertest, OpenAPI contract validation, GraphQL queries and mutations, then OWASP security coverage to finish.
Prompts in this Collection
- 1
REST API Tests with Supertest & Jest
Generate a production-grade API test suite using Supertest and Jest covering happy paths, validation errors, auth, RBAC, and DB isolation — with Zod response shape validation.
Build your REST test foundation: Supertest + Jest with DB isolation and Zod schema assertions.
intermediatejest - 2
Generate API Contract Tests from OpenAPI Spec
Create a production-grade API contract test suite that validates response schemas, status codes, headers, and error payloads against an OpenAPI 3.0 spec.
Lock your API to its spec — contract tests catch breaking changes before consumers do.
advancedplaywright - 3
GraphQL API Test Suite
Generate typed GraphQL tests covering queries, mutations, pagination, error handling, auth, depth limits, and N+1 detection — using graphql-request with Jest and codegen types.
Extend to GraphQL: typed queries, mutation coverage, and security checks like depth limits.
advancedjest - 4
OWASP API Security Top 10 Test Suite
Generate security tests covering OWASP API Security Top 10: broken auth, excessive data exposure, injection, and more.
Close with OWASP Top 10 — broken auth, SSRF, mass assignment, and rate-limit tests.
advancedjest