Skip to content
Cloudflare Docs

Testing

The Workers platform has a variety of ways to test your applications, depending on your requirements. We recommend using the Vitest integration, which allows you to run tests to inside the Workers runtime, and unit test individual functions within your Worker.

Get started with Vitest

Testing comparison matrix

However, if you don't use Vitest, both Miniflare's API and the unstable_startWorker() API provide options for testing your Worker in any testing framework.

FeatureVitest integrationunstable_startWorker()Miniflare's API
Unit testingβœ…βŒβŒ
Integration testingβœ…βœ…βœ…
Loading Wrangler configuration filesβœ…βœ…βŒ
Use bindings directly in testsβœ…βŒβœ…
Isolated per-test storageβœ…βŒβŒ
Outbound request mockingβœ…βŒβœ…
Multiple Worker supportβœ…βœ…βœ…
Direct access to Durable Objectsβœ…βŒβŒ
Run Durable Object alarms immediatelyβœ…βŒβŒ
List Durable Objectsβœ…βŒβŒ
Testing service WorkersβŒβœ…βœ