Testing
Review the tools available for testing and debugging Workers.
Feature | Vitest Pool | unstable_dev() | Miniflare’s API |
---|---|---|---|
Unit testing | ✅ | ❌ | ❌ |
Integration testing | ✅ | ✅ | ✅ |
Loading Wrangler configuration files | ✅ | ✅ | ❌ |
Bindings directly in tests | ✅ | ❌ | ✅ |
Isolated per-test storage | ✅ | ❌ | ❌ |
Outbound request mocking | ✅ | ❌ | ✅ |
Multiple Worker support | ✅ | 🚧1 | ✅ |
Direct access to Durable Objects | ✅ | ❌ | ❌ |
Run Durable Object alarms immediately | ✅ | ❌ | ❌ |
List Durable Objects | ✅ | ❌ | ❌ |
Testing service Workers | ❌ | ✅ | ✅ |
-
Support for multiple Workers in
unstable_dev()
relies onwrangler dev
’s service registry which can be unreliable when running multiple tests in parallel. ↩