Recipes and examples
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 β
- Mocking Workers AI and Vectorize bindings in unit tests β
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