Testing with the client — RPC · Hono

Rewrite the cats API's spec with testClient from hono/testing, the typed client over app.request(), and prove the tests mean something by catching four bugs planted in the code.

What you will learn

Read the theory for Testing with the client

All RPC lessons

All Hono courses

loading types…

What you'll learn

  • Call a Hono app from a test through testClient(app), with paths, bodies and parameters checked by the compiler
  • Narrow a test's response on its status before reading the typed body
  • Measure a spec by the planted bugs it catches, not by the tests it passes