Skip to content

Testing patterns for Hono apps covering app.request(), the typed test client, and environment mocking.

CCM score
59 of 100
skills.sh installs
433
GitHub stars
79
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers request-based unit tests with app.request(), typed client calls via testClient, and validation error assertions
  • Includes GET, POST JSON, form data, and DELETE request examples, plus Cloudflare Workers binding mocks for D1, KV, and env values
  • Shows Miniflare setup for running tests against realistic Workers bindings instead of hand-built mocks
  • Designed for developers writing Vitest or Jest suites for Hono route handlers, middleware, and integration tests

Install

$ npx -y skills add bobmatnyc/claude-mpm-skills --skill hono-testing -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Hono Testing Patterns

Overview

Hono provides a simple testing approach: create a Request, pass it to your app, and validate the Response. The framework includes a typed test client for even better DX.

Key Features:

  • Simple app.request() API
  • Typed test client with full inference
  • Environment mocking for Workers
  • Works with Vitest, Jest, or any test runner

When to Use This Skill

Use Hono testing when:

  • Writing unit tests for route handlers
  • Integration testing API endpoints
  • Testing middleware behavior
  • Mocking Cloudflare Workers bindings
  • Validating request/response cycles

Basic Testing

Using app.request()

import { Hono } from 'hono'
import { describe, it, expect } from 'vitest'

const app = new Hono()

app.get('/hello', (c) => c.text('Hello!'))
app.get('/json', (c) => c.json({ message: 'Hello' }))

describe('Basic routes', () => {
  it('should return text', async () => {
    const res = await app.request('/hello')

    expect(res.status).toBe(200)
    expect(await res.text()).toBe('Hello!')
  })

  it('should return JSON', async () => {
    const res = await app.request('/json')

Details

Repository
github.com/bobmatnyc/claude-mpm-skills
Categories
Testing & QA, Backend & APIs
First seen
Jun 3, 2026

Questions

How do I test Hono routes without starting a server?

The hono-testing skill covers app.request(), which passes a Request straight to your Hono app and lets you check the Response. It also shows a typed test client from hono/testing for calling routes with full type inference.

Can hono-testing mock Cloudflare Workers bindings like D1 and KV?

Yes, the skill shows how to pass mock bindings such as a D1 database, a KV namespace and an API key as the environment argument to app.request(). It also shows using Miniflare for more realistic Workers testing with real bindings.

How do I install the hono-testing skill?

Run npx -y skills add bobmatnyc/claude-mpm-skills --skill hono-testing -y in your project. The agent can then write Vitest or Jest tests for Hono route handlers, validation and middleware.

Where does hono-testing stand in the Testing & QA category?

hono-testing is listed in the Testing & QA category on Claude Marketplaces, alongside tdd, migrate-to-shoehorn, test-driven-development, webapp-testing and break-ui. It is narrower than those, focused only on testing Hono APIs.

More from bobmatnyc/claude-mpm-skills

All 154

Similar to Hono Testing

More Testing & QA