testing

Guide Vitest-based unit and integration testing for LobeChat projects.

30|10|Updated Aug 5, 2024
One-click install
npx skills add https://github.com/find-xposed-magisk/lobe-chat --skill testing-find-xposed-magisk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/find-xposed-magisk/lobe-chat/tree/main/.agents/skills/testing
Command: npx skills add https://github.com/find-xposed-magisk/lobe-chat --skill testing-find-xposed-magisk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Writing and maintaining reliable tests for LobeChat projects is challenging without a clear, shared guide for Vitest, mocking, and test data.

Core Features & Use Cases

  • Structured testing practices: clear patterns for organizing unit, integration, and E2E tests across packages and apps.
  • Mocking and isolation: guidance on when to spy vs mock and how to isolate test environments.
  • Quality assurance workflows: recommendations for test coverage, type checks, and debugging strategies.

Quick Start

Run Vitest to quickly verify changes in a targeted test file.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I structure unit and integration tests with Vitest in a web project?

Vitest unit and integration tests should be organized using clear patterns across packages and apps to isolate web, desktop, and server components for consistent testing workflows.

What's the best way to mock and isolate test environments in Vitest?

Mocking in Vitest involves applying specific guidance on when to spy versus mock, ensuring test environments are properly isolated to maintain reliable quality assurance workflows.

When do I need to use mocking versus spying in Vitest test cases?

Mocking versus spying in Vitest is determined by specific isolation needs, applying guidance on when to spy versus mock to safely isolate test environments and maintain consistent patterns.

How do I improve test coverage and debug failing Vitest tests?

Improving Vitest test coverage and debugging failing tests requires applying quality assurance workflows that recommend specific coverage targets, type checks, and debugging strategies.

Can I use Vitest testing practices across desktop and server components?

Vitest testing practices apply to creating, debugging, and maintaining tests across web, desktop, and server components, ensuring consistent test patterns and coverage improvements.