API Mocking
Mocking Overview
Mock lifecycle, base URLs, and request handling fundamentals.
API Mocking Overview
Faker Forge API mocking lets you model API behavior without depending on live backend services.
Core Objects
- Mock: top-level API surface.
- Endpoint: method + path contract.
- Scenario: conditional response rule.
Base URL Shape
Each mock exposes a base URL where endpoint paths are resolved.
Request Handling Flow
- Incoming request targets a mock endpoint.
- Endpoint method/path is matched.
- Matching scenario is selected.
- Delay and headers are applied.
- Scenario body is returned with status code.
Why This Helps
- Isolate frontend and client testing.
- Reproduce edge cases reliably.
- Simulate outages and latency.
Typical Use Cases
- Contract testing
- Frontend feature development
- QA scenario automation
- Demo environments