QA and edge cases
Test API Errors and Edge Cases Before Production
Give QA teams repeatable local mock API scenarios for authentication failures, service errors, latency, pagination, and realistic test data. Exercise UI states early while keeping the limits of a development mock explicit.
Why is happy-path testing insufficient?
Interfaces fail at boundaries: sessions expire, records disappear, lists are empty, requests slow down, and services become unavailable. A controlled local backend makes these states reproducible before a shared test environment is ready.
Create repeatable datasets
Use a fixed seed and record counts to start from predictable data. Reset or regenerate through the local control API, then use CRUD requests to establish the exact state a test needs.
POST /_mock/reset
POST /_mock/generate
GET /products?page=4&limit=25Check authentication success and failure
Test valid, missing, incorrect, expired, and revoked credentials with bearer, API-key, or Basic modes. Verify redirects, reauthentication, protected-route handling, and safe error messages.
Exercise error responses honestly
Global failure injection produces probabilistic HTTP 503 responses. Real runtime behavior also produces 400 for invalid queries, 401 or a configured unauthorized status, 404 for missing resources, and 409 when deleting a referenced parent. Arbitrary route-specific 403, 422, 429, or 500 scenarios are not currently configurable.
Test slow requests and loading behavior
Set a fixed response delay to inspect spinners, skeletons, disabled controls, timeouts, duplicate submissions, and navigation while a request is pending. Change the latency through the runtime control API between scenarios.
PUT /_mock/config
content-type: application/json
{ "latency": 1500, "errorRate": 0 }Cover empty, boundary, and pagination cases
Use a zero or small record set for empty states, request the last and beyond-last pages, test the maximum allowed limit, search for absent values, and submit a sort field outside the allowlist.
Know what the mock does not replace
A local mock does not validate production security, database constraints, deployment configuration, real network infrastructure, backend performance, or third-party integrations. Keep contract, integration, security, load, and end-to-end tests against appropriate real environments.
Build a focused QA project
Start with the screens that have the highest state complexity. Document the seed, runtime controls, credentials, and requests for each scenario so another tester can reproduce it.
Related questions
Can I force any HTTP status on any route?
No. The current runtime has a global probabilistic 503 plus statuses produced by auth, validation, missing data, and relationships.
Keep exploring
Last updated September 17, 2026. Product behavior described here is verified against the current Mock API Studio runtime.