Agent skill · Testing & QA

testing

Vitest testing guide. Use when writing or updating tests, fixing failing tests, improving coverage, debugging test issues, or setting up mocks.

LobeHub80,937★ · +310/wk · 1 repos on radarProfile →
claude-codeNOASSERTION
Install
npx skills add lobehub/lobehub --skill testing --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 6
SKILL.md size: 6 KB
Bundled scripts: none
Path: .agents/skills/testing/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 81,252 · +315 this week
Language: TypeScript
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# LobeHub Testing Guide ## Quick Reference **Commands:** ```bash # Run specific test file bunx vitest run --silent='passed-only' '[file-path]' # Database package (client-db, PGlite — default, skips BM25/pg_search) 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/**` > or `src/repositories/**` ships with a sibling `__tests__/<name>.test.ts` in the same PR. > Use the real DB via `getTestDB()` (integration style), guard BM25/full-text-search blocks > with `describe.skipIf(!isServerDB)`, and always test user-isolation. See > `references/db-model-test.md` for setup, schema gotchas, and the client-vs-server-db split. ## Test Categories | Category | Location | Config | | -------- | --------------------------- | ------------------------------- | | Webapp | `src/**/*.test.ts(x)` | `vitest.config.ts` | | Packages | `packages/*/**/

What's inside
Steps it walks through
  1. Quick Reference
  2. Test Categories
  3. Core Principles
  4. Basic Test Structure
  5. Mock Patterns
  6. Detailed Guides
  7. Fixing Failing Tests — Optimize or Delete?
  8. Keep & Fix (update test data/assertions)
  9. Delete (over-specified, low value)
  10. Decision Checklist
  11. When Writing New Tests
  12. Common Issues
Ships with 5 files
  • references/agent-runtime-e2e.md
  • references/db-model-test.md
  • references/desktop-controller-test.md
  • references/electron-ipc-test.md
  • references/zustand-store-action-test.md
Commands it runs
Run specific test file
bunx vitest run --silent='passed-only' '[file-path]'
Database package (client-db, PGlite — default, skips BM25/pg_search)
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]'
More from lobehub
All skills →
About this skill
What does the testing skill do?

Vitest testing guide. Use when writing or updating tests, fixing failing tests, improving coverage, debugging test issues, or setting up mocks.

How do I install it?

Run `npx skills add lobehub/lobehub --skill testing --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From lobehub/lobehub, a repository with 81,252 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going