Updated: 2026-03-25
api-test-supertest
Basic Information
Full Skill Guide
When
- API changes may break contract, data shape, auth, or error handling.
- Backend is ready before UI and API needs early verification.
- Regression confidence is needed for integration and release.
What
- Validate request/response behavior using Supertest-based Node.js API verification.
- Detect contract mismatch, status-code drift, and data integrity issues.
- Provide evidence for API readiness and downstream integration safety.
How
- Define API scope by endpoint criticality and business flow dependency.
- Prepare test matrix: happy path, validation errors, auth, idempotency, and boundary data.
- Execute with deterministic fixtures and environment isolation.
- Verify status, schema, key fields, and side effects.
- Log failures with reproducible request payload and correlation id.
- Summarize API quality with pass rate, top risks, and follow-up tests.
Reference
Positive Example (Input -> Output)
Input:
- Endpoint:
POST /orders - Rules: member coupon + stock lock + timeout rollback
Output:
- Cases covering valid order, invalid coupon, insufficient stock, replay protection
- Defect found: rollback missing when payment timeout occurs
- Recommendation: block release until compensation path is fixed
Negative Example (Input -> Output)
Input:
- "Test all order APIs"
Output (problem):
- Only 200-response checks, no schema validation or negative path
- Misses contract-breaking field type change
Limits
- Do not test APIs without environment/data setup clarity.
- Do not rely on status code alone for correctness.
- Do not ignore side-effect validation for write APIs.
- Do not hide flaky assertions caused by unstable test data.
- Do not claim integration safety without contract verification.
Usage Guide
- Install and enable
api-test-supertestfirst (use the install commands in this page). - In your request, provide required context: scope, environment, timeline, and expected output format.
- Trigger with API context, for example: "Use
api-test-superteston /orders and /payments in staging." - Provide auth/data details and ask for outputs: test matrix, assertions, and defect evidence format.
- Execute in two rounds: smoke first, then negative/boundary regression.
Installation
Platform
AI Tool
Quick install (one line)
Generating command... Full script
Loading script...