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โŒโœ…โœ