testing

Run Vitest unit and integration tests for LobeHub webapp, packages, and desktop applications.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/dodevproject/lobe-chat --skill testing-dodevproject
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/dodevproject/lobe-chat/tree/main/.agents/skills/testing
Command: npx skills add https://github.com/dodevproject/lobe-chat --skill testing-dodevproject

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides guidance and commands for writing, debugging, and improving tests within the LobeHub project, ensuring code quality and stability.

Core Features & Use Cases

  • Efficient Test Execution: Run specific test files or categories quickly without executing the entire test suite.
  • Mocking Strategies: Learn best practices for mocking dependencies using vi.spyOn and vi.stubGlobal.
  • Test Structure & Principles: Understand the core principles and basic structure for writing maintainable tests.
  • Detailed Guides: Access specific guides for testing databases, IPC, Zustand stores, and agent runtimes.

Quick Start

Use the testing skill to run all tests within the packages/database directory.

Frequently Asked Questions about testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write unit and integration tests for LobeHub using Vitest?

To write unit and integration tests using Vitest, you should follow core testing principles and basic test structures. This skill provides specific commands and detailed guides to help you execute tests across webapp, packages, and desktop applications.

What is the best way to mock dependencies in Vitest for my testing workflow?

The best way to mock dependencies in Vitest is by utilizing specific mocking strategies like vi.spyOn and vi.stubGlobal. These methods allow you to effectively isolate modules and control function behaviors during your test execution.

How do I test Electron IPC and Zustand stores in a LobeHub project?

To test Electron IPC and Zustand stores, you can access detailed guides provided for these specific components. These references ensure you properly handle state management and inter-process communication within your test suite.

Can I run specific test files or categories without executing the entire Vitest test suite?

Yes, you can run specific test files or categories without executing the entire suite. This skill enables efficient test execution, allowing you to target specific directories like packages/database to streamline your testing workflow.

How do I handle E2E testing scenarios for agent runtimes?

For E2E testing scenarios involving agent runtimes, you should refer to the detailed testing references included. These guides provide the necessary commands and strategies to validate complex agent behaviors effectively.