Agent skill · Audited from source
testing
skill · lobehub/lobehubNOASSERTION licenceAudited 31 Oct 2026 · source f6210ec238fd
Is it safe? With care — CAUTION, grade B (89/100). We read this skill's source at commit f6210ec238fd and found no filesystem, network or shell access and no hard-coded secrets. The audit raised 4 findings, 0 critical or high. What it does: Use for Vitest tests, mocks, coverage and failing-test diagnosis.
Cite
Cite this page
ModelsAtlas. “testing (lobehub/lobehub)”. Retrieved 31 Oct 2026. https://modelsatlas.com/skills/lobehub/testing
6 skills are called “testing”. You are viewing lobehub/lobehub.
- lobehub/lobehub★ 84k!CAUTION
- tursodatabase/turso★ 25k!CAUTION
- NVIDIA/Megatron-LM★ 18k!CAUTION
- dotnet/efcore★ 15k✓SAFE
- bytebase/dbhub★ 3.6k✓SAFE
and 1 more with this name.
Trust audit
Audit 0.4.1 · source read 31 Oct 2026
CAUTION means the audit found things worth knowing before you trust this skill. Grade B is shared by 16,667 of 17,602 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | WARN | 4 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (4)
MEDIUMInventory / provenanceinv.symlink · .claude/skills
.claude/skills
- Why
- link not followed
- Fix
- —
MEDIUMInventory / provenanceinv.symlink · .codex/skills
.codex/skills
- Why
- link not followed
- Fix
- —
MEDIUMInventory / provenanceinv.symlink · .cursor/skills
.cursor/skills
- Why
- link not followed
- Fix
- —
MEDIUMInventory / provenanceinv.symlink · .gemini/skills
.gemini/skills
- Why
- link not followed
- Fix
- —
Audit 0.4.1 · source sha f6210ec238fd · 31 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publisherlobehub GitHub organizationOwner of the repository this skill is read from
- Source folderlobehub/lobehub/.agents/skills/testingThe exact folder we audited
- LicenceNOASSERTIONAs the repository states it
- Commit pinned for this verdictf6210ec238fdA new audit runs when the source changes
- Repository statusNot archivedPushed today
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Use for Vitest tests, mocks, coverage and failing-test diagnosis.
---
name: testing
description: 'Use for Vitest tests, mocks, coverage and failing-test diagnosis.'
user-invocable: false
---
# 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, 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/**`
> 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/*/**/*.test.ts` | `packages/*/vitest.config.ts` |
| Desktop | `apps/desktop/**/*.test.ts` | `apps/desktop/vitest.config.ts` |
## Core Principles
1. **Prefer `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()`.
2. **Test behavior, not implementation details**
- Keep native `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.
3. **Regression tests for bug fixes** - Include a regression test that fails without the fix and passes with it; write the failing test first when the failure is easy to reproduce. **Skip** pure style/CSS fixes (selector, hover, mask, spacing, color) when the only practical assertion would be source-string matching on the stylesheet — that is not a regression test worth shipping.
4. **No new component tests** - Only update existing React component tests. Complex logic should be extracted into hooks and tested there instead
## UI Library Mocks (@lobehub/ui/base-ui)
**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):
```typescript
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.
## Detailed Guides
See `references/` for specific testing scenarios:
- **Database Model testing**: `references/db-model-test.md`
- **Electron IPC testing**: `references/electron-ipc-test.md`
- **Zustand Store Action testing**: `references/zustand-store-action-test.md`
- **Agent Runtime E2E testing**: `references/agent-runtime-e2e.md`
- **Desktop Controller testing**: `references/desktop-controller-test.md`
## Fixing Failing Tests — Optimize or Delete?
When tests fail due to implementation changes (not bugs), evaluate before blindly fixing:
### Keep & Fix (update test data/assertions)
- **Behavior tests**: Tests that verify _what_ the code does (output, side effects, user-visible behavior). Just update mock data formats or expected values.
- Example: Tool data structure changed from `{ name }` to `{ function: { name } }` → update mock data
- Example: Output format changed from `Current date: YYYY-MM-DD` to `Current date: YYYY-MM-DD (TZ)` → update expected string
### Delete (over-specified, low value)
- **Param-forwarding tests**: Tests that assert exact internal function call arguments (e.g., `expect(internalFn).toHaveBeenCalledWith(expect.objectContaining({ exact params }))`) — these break on every refactor and duplicate what behavior tests already cover.
- **Implementation-coupled tests**: Tests that verify _how_ the code works internally rather than _what_ it produces. If a higher-level test already covers the same behavior, the low-level test adds maintenance cost without coverage gain.
### Decision Checklist
1. Does the test verify **externally observable behavior** (API response, DB write, rendered output)? → **Keep**
2. Does the test only verify **internal wiring** (which function receives which params)? → Check if a behavior test already covers it. If yes → **Delete**
3. Is the same behavior already tested at a **higher integration level**? → Delete the lower-level duplicate
4. Would the test break again on the **next routine refactor**? → Consider raising to integration level or deleting
### When Writing New Tests
- Prefer **integration-level assertions** (verify final output) over **white-box assertions** (verify iExcerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit f6210ec
git clone https://github.com/lobehub/lobehub git -C lobehub checkout f6210ec238fd
The author documents no install command, so this uses the repository directly. Our verdict covers commit f6210ec238fd only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- !CAUTION B 89 / 100
first audit · source
f6210ec238fd
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/lobehub/testing/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
All testing skills →lobehub/lobehub
Use for TypeScript style and type safety when editing TS/TSX/MTS, including imports, async code and error suppression.
lobehub/lobehub
Use for Upstash Workflow/QStash handlers, triggers, durable steps and async fan-out.
lobehub/lobehub
Explicit compatibility entry for Zustand data-shape guidance.
lobehub/lobehub
Use for TSX components, UI libraries, styling, state locality, layout, render performance and memoization.
lobehub/lobehub
Use for the OSS repository map, code-layer lookup, apps/packages/src ownership and business stubs.
lobehub/lobehub
Use for modals, dialogs and confirmations with createModal, confirmModal, ModalHost or base-ui modal APIs.
Add this badge to your README
[](https://modelsatlas.com/skills/lobehub/testing/)
<a href="https://modelsatlas.com/skills/lobehub/testing/"><img src="https://modelsatlas.com/skills/lobehub/testing/badge.svg" alt="ModelsAtlas: CAUTION B"></a>
Questions about testing
What does the testing skill do?
Is testing safe to install?
What can testing access on my machine?
How current is this page?
Sources
- github.com/lobehub/lobehub/tree/canary/.agents/skills/testing — the audited source at commit f6210ec238fd and every finding aboveObserved · 31 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the testing skill do?
- Is testing safe to install?
- What can testing access on my machine?