tessl install tessl-labs/quickstart-debug-api-endpoints@1.0.5Quickstart example: Systematic API testing workflow (skill)
Follow this systematic workflow when testing or debugging Express.js API endpoints. This ensures comprehensive coverage and faster troubleshooting.
Before testing endpoints, ensure the basic infrastructure is working:
/health or / endpoint returns 200What to check:
# Server starts
npm start
# Health check responds
curl http://localhost:3000/health
# Expected: 200 OKTest authentication and authorization before functional tests:
What to check:
# No authentication
curl http://localhost:3000/api/protected
# Expected: 401 Unauthorized
# Valid authentication
curl -H "Authorization: Bearer <token>" http://localhost:3000/api/protected
# Expected: 200 OK or 403 ForbiddenTest input validation and error handling:
What to check:
# Missing required field
curl -X POST http://localhost:3000/api/posts \
-H "Content-Type: application/json" \
-d '{"title": ""}'
# Expected: 400 Bad Request with validation error
# Invalid format
curl -X POST http://localhost:3000/api/users \
-H "Content-Type: application/json" \
-d '{"email": "not-an-email"}'
# Expected: 400 Bad RequestTest the actual business logic:
What to check:
# Happy path
curl -X POST http://localhost:3000/api/posts \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"title": "Test Post", "body": "Content here"}'
# Expected: 201 Created with post data
# Not found
curl http://localhost:3000/api/posts/nonexistent-id
# Expected: 404 Not Found
# Duplicate
curl -X POST http://localhost:3000/api/posts \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"title": "Existing Title", "body": "Content"}'
# Expected: 409 Conflict if duplicateWhen debugging issues, follow the steps in order:
Common Issues: