references/miniflare/README.md
Miniflare
Miniflare provides programmatic control of local Workers simulation. Read the linked documentation before choosing APIs, configuration, or a migration path.
Choose the testing tool
| Need | Start here | |------|------------| | Unit tests that execute in the Workers runtime | Workers Vitest setup | | Integration tests against built Workers | Integration test harness | | Low-level simulator control for a custom harness | Miniflare testing guide | | Binding access from a Node.js process | Wrangler getPlatformProxy |
For interactive local development, use the project's Wrangler or Cloudflare Vite workflow. Direct Miniflare is useful when the higher-level testing tools do not expose the control needed.
Read for the task
- Get started — installation, scripts, lifecycle, and event dispatch.
- API routing — events and access to local resources.
- Configuration — modules, bindings, compatibility, and multiple Workers.
- Testing patterns — runtime choice, mocking, and test lifecycle.
- Troubleshooting and migrations — build/configuration differences and existing test suites.