hono-testkit: in-memory Cloudflare bindings for Hono tests #5386
md-sagban
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
I built
hono-testkitwhile working on tests for Hono applications that use Cloudflare bindings. I wanted a simple way to test routes with controlled state without connecting to real Cloudflare resources or starting a Workers runtime for every test.The package currently provides:
ExecutionContextmock with support for drainingwaitUntil()workThe core package does not depend on a test runner. I have documented examples for Vitest, Jest,
node:test, and Bun.This is not intended to replace Cloudflare's Vitest integration. Runtime-specific behavior, persistence, concurrency, and Durable Objects should still be tested with
workerd. The package is for fast unit and route tests where deterministic bindings are more useful than runtime fidelity.Version
0.1.0is available now:I would appreciate feedback from people testing Hono applications on Cloudflare, especially about missing binding behavior or APIs that feel awkward in real test suites.
All reactions