From ad88c4cfac17e464ab422cf8816fb2a33c3231f9 Mon Sep 17 00:00:00 2001 From: Lee Cheneler Date: Mon, 1 Dec 2025 00:23:21 +0000 Subject: [PATCH] docs: add missing module READMEs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add documentation for test-utils and type-utils modules. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- test-utils/README.md | 39 +++++++++++++++++++++++++++++++++++++++ type-utils/README.md | 28 ++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 test-utils/README.md create mode 100644 type-utils/README.md diff --git a/test-utils/README.md b/test-utils/README.md new file mode 100644 index 0000000..c453d8b --- /dev/null +++ b/test-utils/README.md @@ -0,0 +1,39 @@ +# test-utils + +Test server for running Tabi apps in tests. + +## Installation + +```typescript +import { TabiTestServer } from "@tabirun/app/test-utils"; +``` + +## Usage + +```typescript +Deno.test("GET /health returns 200", async () => { + const server = new TabiTestServer(); + + server.app.get("/health", (c) => c.json({ status: "ok" })); + server.start(); + + const res = await fetch(server.url("/health")); + assertEquals(res.status, 200); + + await server.stop(); +}); +``` + +## API + +- `new TabiTestServer()` - Create test server instance +- `app` - The underlying `TabiApp` instance +- `start(port?)` - Start server (uses random port if not specified) +- `url(path)` - Get HTTP URL for path +- `wsUrl(path)` - Get WebSocket URL for path +- `stop()` - Gracefully shutdown server + +## Notes + +- Uses port 0 by default to avoid "address in use" errors +- Always call `stop()` after tests to release resources diff --git a/type-utils/README.md b/type-utils/README.md new file mode 100644 index 0000000..9eb0c6e --- /dev/null +++ b/type-utils/README.md @@ -0,0 +1,28 @@ +# type-utils + +Type utilities for internal use. + +## Installation + +```typescript +import { type PublicOf } from "@tabirun/app/type-utils"; +``` + +## Usage + +```typescript +class MyClass { + private _secret = "hidden"; + public name = "visible"; + public greet() { + return "hello"; + } +} + +type MyPublicAPI = PublicOf; +// { name: string; greet: () => string } +``` + +## Types + +- `PublicOf` - Extracts public interface of a class or object