The Miniflare API allows you to dispatch events to workers without making actual HTTP requests, simulate connections between Workers, and interact with local emulations of storage products like KV, R2, and Durable Objects. This makes it great for writing tests, or other advanced use cases where you need finer-grained control.
We can use miniflare to add test for rate limiter.
Additional Resource:
https://developers.cloudflare.com/workers/testing/miniflare/writing-tests/
The
Miniflare APIallows you to dispatch events to workers without making actual HTTP requests, simulate connections between Workers, and interact with local emulations of storage products like KV, R2, and Durable Objects. This makes it great for writing tests, or other advanced use cases where you need finer-grained control.We can use
miniflareto add test for rate limiter.Additional Resource:
https://developers.cloudflare.com/workers/testing/miniflare/writing-tests/