v0.45.0 — test client
A first-class test harness — inject requests without a server, the way Fastify's inject() works.
testClient(target)injects requests into your app and returns aTestResponse. Accepts anApplication(built through a fresh kernel), anHttpKernel(to register global middleware first), or anyrequest()-able (a built Hono instance).- Verb helpers —
get/delete, andpost/put/patchwith an auto JSON-encoded body;request()for full control. - Fluent assertions —
assertStatus/assertOk/assertJson/assertText/assertHeader/assertRedirect, chainable, throwing a descriptive error (with the body) on mismatch. - The response body is pre-buffered, so reads are synchronous and repeatable — no "body already consumed".
Edge-safe: the same fetch-style injection Keel's own suite uses, minus the boilerplate. 286 tests; type-checked doc examples. See docs/testing.md.