Recipes
Recipes are examples that help demonstrate how to write unit tests and integration tests for Workers projects using the @cloudflare/vitest-pool-workers ↗ package.
- Basic unit and integration tests for Workers using 
SELF↗ - Basic unit and integration tests for Pages Functions using 
SELF↗ - Basic integration tests using an auxiliary Worker ↗
 - Basic integration test for Workers with static assets ↗
 - Isolated tests using KV, R2 and the Cache API ↗
 - Isolated tests using D1 with migrations ↗
 - Isolated tests using Durable Objects with direct access ↗
 - Tests using Queue producers and consumers ↗
 - Tests using Hyperdrive with a Vitest managed TCP server ↗
 - Tests using declarative/imperative outbound request mocks ↗
 - Tests using multiple auxiliary Workers and request mocks ↗
 - Tests importing WebAssembly modules ↗
 - Tests using JSRPC with entrypoints and Durable Objects ↗
 - Integration test with static assets and Puppeteer ↗
 - Resolving modules with Vite Dependency Pre-Bundling ↗
 
Was this helpful?
- Resources
 - API
 - New to Cloudflare?
 - Products
 - Sponsorships
 - Open Source
 
- Support
 - Help Center
 - System Status
 - Compliance
 - GDPR
 
- Company
 - cloudflare.com
 - Our team
 - Careers
 
- 2025 Cloudflare, Inc.
 - Privacy Policy
 - Terms of Use
 - Report Security Issues
 - Trademark