back
loading skill details...
testing — an installable skill for AI agents, published by lobehub/lobehub.
Vitest testing guide for LobeHub with commands, patterns, and best practices. Run specific test files with bunx vitest run commands; avoid bun run test which runs 3000+ tests (~10 minutes) Prefer vi.spyOn over vi.mock for targeted, maintainable mocks; use vi.stubGlobal for browser APIs Test observable behavior rather than implementation details; delete param-forwarding tests that duplicate higher-level coverage Includes detailed guides for database models, Electron IPC, Zustand stores, agent runtime E2E, and desktop controllers Tests must pass type check; use beforeEach/afterEach for mock cleanup and state isolation LobeHub Testing Guide Quick Reference Commands: # Run specific test file bunx vitest run --silent='passed-only' '[file-path]' # Database package (client) cd packages/database && bunx vitest run --silent='passed-only' '[file]' # Database package (server) 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).
don't have the plugin yet? install it then click "run inline in claude" again.