Developer tool
Mockery.
Define the API behavior you need to test.
A mock REST server with YAML configuration, request matching, and a built-in browser editor. Run it from a single downloaded binary.
- Go
- TypeScript
- YAML
The problem it solves
Predictable responses while an API is still changing
Frontend work and integration tests often need API responses before the backend is ready. They also need cases that are awkward to reproduce on demand, such as authorization failures or slow responses.
Mockery lets you define those responses as endpoints and matching cases. Use the browser editor to configure them visually, or keep the YAML configuration alongside your code.
What it does
YAML or browser configuration
Create endpoints, cases, and responses in the browser editor, then import or export YAML for reuse.
Request matching
Choose responses using authentication tokens, query parameters, headers, and JSON body fields. Cases are evaluated in priority order.
Response simulation
Configure status codes, headers, response bodies, latency, and CORS to exercise different client behaviors.
One downloaded binary
Run the mock server or its browser editor on macOS, Linux, or Windows without installing a separate runtime.
Try it locally
Get started
Download the binary for your operating system and processor from GitHub Releases. The following examples start the local browser editor.
Download a release →macOS or Linux
Rename the downloaded binary to mockery and run these commands from its directory.
bashchmod +x ./mockery ./mockery uiWindows
Download mockery-windows-amd64.exe and run it from PowerShell in the download directory. Windows does not need chmod.
powershell.\mockery-windows-amd64.exe uiOpen the editor
Open http://localhost:4000 in your browser. Configure endpoints and responses, then start the mock server from the editor.
The downloaded binary does not need Go or Node.js. Building from source has additional Go and frontend requirements. Follow the repository instructions for source builds.
Before you use it
- Mock responses reproduce the cases you configure. They do not verify that the real backend has the same behavior.
- When multiple cases match, the first case in priority order wins. Put broad fallback cases after more specific cases.
- The browser editor runs locally. No hosted public demo is provided here.
Source and documentation
- Project README and configuration reference ↗
- CLI source ↗
- Build instructions ↗
- Published release v0.1.0 ↗
License: MIT. See the repository for current releases and requirements.