testing

Guide building and maintaining Vitest-based tests for LobeChat applications.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a structured guide for building, maintaining, and debugging Vitest-based tests for LobeChat projects, reducing flaky tests and speeding up development.

Core Features & Use Cases

  • Test structure guidance: organizes tests for web, servers, and desktop components with consistent naming and configuration.
  • Mocking patterns: demonstrates safe, targeted mocking, spy patterns, and isolation to improve test reliability.
  • Guidelines and troubleshooting: covers common issues, best practices, and debugging strategies for rapid test iteration.

Quick Start

bunx vitest run --silent='passed-only' '[file-or-directory-of-tests]'

Frequently Asked Questions about testing

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

FAQPage Schema
How do I structure Vitest tests for LobeChat web and desktop contexts?

Vitest tests for LobeChat should be organized by separating web, server, and desktop components into distinct directories with consistent naming conventions and configuration files to ensure reliable execution across environments.

What is the best way to mock modules in Vitest to prevent flaky tests?

Mocking modules in Vitest requires using targeted spy patterns and strict isolation techniques to safely replace dependencies, which prevents flaky tests and ensures reliable test execution during rapid development.

How do I run Vitest tests silently to only see failed test output?

Running Vitest tests silently to see only failed output requires using the command `bunx vitest run --silent='passed-only'` followed by your specific test file or directory path for rapid iteration.

Why does my Vitest test suite fail when testing LobeChat desktop components?

Vitest test suites for LobeChat desktop components often fail due to improper test isolation or insufficient mocking of platform-specific APIs, requiring targeted mock patterns to resolve execution errors.

Can I use Vitest for debugging TypeScript test failures in LobeChat?

Vitest can be used for debugging TypeScript test failures in LobeChat by applying structured troubleshooting strategies, utilizing best practices for test isolation, and leveraging Vitest's built-in debugging features.