Skip to main content
Run any Skill in Manus
with one click

backend-testing

Stars2
Forks0
UpdatedJuly 14, 2026 at 12:48

このモノレポ(project-template-2026)の `apps/backend`(Hono BFF)でテストを書く/直す/レビューするときの唯一の実装ガイド。ルート単体テストを PGlite(インメモリ Postgres)上で request→db→response で回し、`hono/testing` の `testClient` で型付き RPC として叩く方式・共通ヘルパ(`support.ts` / `seed.ts`)・session/認可の seed・並列性・落とし穴を集約する。以下のいずれかのとき必ず読むこと —— (1) `apps/backend` に新しいルートのテストを追加する/既存テストを直す・レビューする、(2) PGlite・`vi.mock('@icasu/db/client')`・`migrateTestDb`・`withSession`・`testSession`・`seedTask`・`seedSessionUser`・`testClient`・`InferRequestType` の使い方を知りたい、(3) テストで DB を差し替える/マイグレーションを当てる/session や role を用意する/楽観ロック(body の `expectedVersion`)や zValidator の 400/404/409 を検証する、(4) 「テストが並列で衝突しないのはなぜか」「negative test で型が通らない」等のテスト特有の疑問がある。バックエンドのテストに関わるならまずこのスキルを読む。

Installation

Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.

SKILL.md
readonly