実際の製品を操作して、利用者が確認できる動作証拠を集め、検証計画に沿った受け入れレポートとして公開するスキルです。
- 変更後の製品動作を実地で検証したいとき
- 画面キャプチャなどの証拠を集めたいとき
- 検証計画とレポートを作成したいとき
Vitestのテスト作成や失敗原因の調査で、モックの使い分け、実装詳細に偏らない検証、データベースやUIなど対象別のテスト方針を確認できます。
Use for Vitest tests, mocks, coverage and failing-test diagnosis.
実行スコア 未検証
インストール方法を見るVitestを使うテストの実行・作成・失敗調査に関するプロジェクト内の方針を確認できます。テストファイル単位で実行する方法や、Webアプリ、パッケージ、デスクトップのテスト配置を示します。モックは原則としてvi.spyOnを優先し、内部の呼び出し方ではなく外から観察できる振る舞いを検証します。バグ修正には回帰テストを加え、データベースモデルでは実DBを使ったテストやユーザー分離の確認を扱います。失敗テストについて、挙動を守るテストは更新し、実装に過度に結びついた重複テストは削除を検討する判断基準もあります。
Vitestのテストを追加する開発者や、実装変更で壊れたテストを見直すときに役立ちます。UIライブラリのモック方法、DBテストの分け方、テストの保守性を判断したい場合にも参照できます。
案内されている実行例はbunx vitestを使います。bun run testは3000件以上を実行するため避けるよう記載されています。
この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。
SKILL.md の記述から、注意が要る操作と導入の前提を AI が確認しました。点数は実際に動かした結果(実行検証)だけで付けています。
点数には入れていません。 2026年10月26日 時点で AI(OpenAI Codex)が判定しました。目安なので、入れる前に原文も確認してください。
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Commands:
# Run specific test file
bunx vitest run --silent='passed-only' '[file-path]'
# Database package (client-db, PGlite — default, no pg_search; BM25 migrations skip themselves)
cd packages/database && bunx vitest run --silent='passed-only' '[file]'
# Database package (server-db, Postgres — BM25/pgvector parity, what CI measures coverage in)
cd packages/database && TEST_SERVER_DB=1 bunx vitest run --silent='passed-only' '[file]'
Never run bun run test - it runs all 3000+ tests (~10 minutes).
Database models/repositories: every new file under
packages/database/src/models/**orsrc/repositories/**ships with a sibling__tests__/<name>.test.tsin the same PR. Use the real DB viagetTestDB()(integration style), guard BM25/full-text-search blocks withdescribe.skipIf(!isServerDB), and always test user-isolation. Seereferences/db-model-test.mdfor setup, schema gotchas, and the client-vs-server-db split.
| Category | Location | Config |
|---|---|---|
| Webapp | src/**/*.test.ts(x) | vitest.config.ts |
| Packages | packages/*/**/*.test.ts | packages/*/vitest.config.ts |
| Desktop | apps/desktop/**/*.test.ts | apps/desktop/vitest.config.ts |
vi.spyOn over vi.mock - More targeted, easier to maintain. The root Vitest configs do not restore mocks automatically; restore spies in test cleanup with vi.restoreAllMocks().node:test CI checks under .github/scripts/, outside the app Vitest discovery paths. When mixing test runners, verify both the intended runner and the owning Vitest project's file discovery before pushing.Default: do NOT mock @lobehub/ui/base-ui — render the real components.
vitest.config.mts redirects the library's internal MotionProvider to a static
stub (tests/mocks/lobehubUiMotionProvider.tsx), so base-ui components render in
tests without the app-level ConfigProvider. Please wrap your app with <ConfigProvider> (or <MotionProvider>) in a test means that redirect is not in
effect (e.g. a package-local vitest config) — do not fix it by hand-mocking every
component.
When a test genuinely wants simplified DOM, compose the canonical stubs over the real module instead of writing a closed factory (closed factories break whenever the library migrates a component's import path):
vi.mock('@lobehub/ui/base-ui', async (importOriginal) => ({
...(await importOriginal<object>()),
...(await import('~base-ui-stubs')).baseUiStubs,
}));
~base-ui-stubs (tests/mocks/baseUiStubs.tsx) covers ActionIcon / Button /
Text / Tag / Avatar / Alert / toast / confirmModal / createModal with standard
aria semantics. A per-file factory is still fine when assertions need bespoke
testid conventions — but keep it composed over importOriginal so unknown
exports never go missing.
See references/ for specific testing scenarios:
references/db-model-test.mdreferences/electron-ipc-test.mdreferences/zustand-store-action-test.mdreferences/agent-runtime-e2e.mdreferences/desktop-controller-test.mdWhen tests fail due to implementation changes (not bugs), evaluate before blindly fixing:
{ name } to { function: { name } } → update mock dataCurrent date: YYYY-MM-DD to Current date: YYYY-MM-DD (TZ) → update expected stringexpect(internalFn).toHaveBeenCalledWith(expect.objectContaining({ exact params }))) — these break on every refactor and duplicate what behavior tests already cover.expect.objectContaining only for stable, public-facing contracts — not for internal param shapes that change with refactorsまだレビューはありません。使ってみた感想をお寄せください。
ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。
まだコメントはありません。最初のコメントを書いてみませんか。
実際の製品を操作して、利用者が確認できる動作証拠を集め、検証計画に沿った受け入れレポートとして公開するスキルです。
LobeHubにAIモデルプロバイダーを追加し、実行時連携からモデル表示、設定、ブランド表記、文書化、動作確認まで進めるスキルです。
ユーザー設定の初期値をサーバー側の環境変数で切り替えるため、型定義や設定の組み立て、ユーザーストアへの反映、環境変数の例と説明書きを追加する手順です。
エージェント実行中の各段階をフックで監視し、ツール呼び出しの模擬・制御や人の承認、圧縮、サブエージェント処理に介入する仕組みを扱います。
イベントを起点にエージェントのバックグラウンド処理を組み立て、ソース・シグナル・アクション・ポリシーの役割分担や非同期連携を実装するためのスキルです。
DiscordやSlackなどの実際のチャットアプリでボットにメッセージを送り、応答を画面で確認する受け入れテストを行うスキルです。