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