testing — agent-collaboration testing, lobehub, community, agent-collaboration, ide skills, agent-harness, chatgpt, deepseek, gemini, knowledge-base, Claude Code

v1.0.0

关于此技能

非常适合需要使用 vitest 的高效测试框架的开发者代理 Testing guide using Vitest. Use when writing tests (.test.ts, .test.tsx), fixing failing tests, improving test coverage, or debugging test issues. Triggers on test creation, test debugging, mock setup, or test-related questions.

# 核心主题

lobehub lobehub
[73.3k]
[14750]
更新于: 3/9/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 6/11

This page remains useful for operators, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution
Review Score
6/11
Quality Score
49
Canonical Locale
en
Detected Body Locale
en

非常适合需要使用 vitest 的高效测试框架的开发者代理 Testing guide using Vitest. Use when writing tests (.test.ts, .test.tsx), fixing failing tests, improving test coverage, or debugging test issues. Triggers on test creation, test debugging, mock setup, or test-related questions.

核心价值

使代理能够使用 vitest 静默运行特定的测试文件,并与团队成员合作使用综合测试框架,使用类似 'bunx vitest run' 的命令,并使用 TEST_SERVER_DB 环境变量处理数据库包

适用 Agent 类型

非常适合需要使用 vitest 的高效测试框架的开发者代理

赋予的主要能力 · testing

使用 vitest 运行特定的测试文件
在客户端和服务器端测试数据库包
与团队成员合作使用综合测试框架

! 使用限制与门槛

  • 需要 vitest 安装
  • Bun 运行环境必要
  • 避免运行 'bun run test' 因为广泛的测试套件

Why this page is reference-only

  • - Current locale does not satisfy the locale-governance contract.
  • - The underlying skill quality score is below the review floor.

Source Boundary

The section below is supporting source material from the upstream repository. Use the Killer-Skills review above as the primary decision layer.

实验室 Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

常见问题与安装步骤

以下问题与步骤与页面结构化数据保持一致,便于搜索引擎理解页面内容。

? FAQ

testing 是什么?

非常适合需要使用 vitest 的高效测试框架的开发者代理 Testing guide using Vitest. Use when writing tests (.test.ts, .test.tsx), fixing failing tests, improving test coverage, or debugging test issues. Triggers on test creation, test debugging, mock setup, or test-related questions.

如何安装 testing?

运行命令:npx killer-skills add lobehub/lobehub/testing。支持 Cursor、Windsurf、VS Code、Claude Code 等 19+ IDE/Agent。

testing 适用于哪些场景?

典型场景包括:使用 vitest 运行特定的测试文件、在客户端和服务器端测试数据库包、与团队成员合作使用综合测试框架。

testing 支持哪些 IDE 或 Agent?

该技能兼容 Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer。可使用 Killer-Skills CLI 一条命令通用安装。

testing 有哪些限制?

需要 vitest 安装;Bun 运行环境必要;避免运行 'bun run test' 因为广泛的测试套件。

安装步骤

  1. 1. 打开终端

    在你的项目目录中打开终端或命令行。

  2. 2. 执行安装命令

    运行:npx killer-skills add lobehub/lobehub/testing。CLI 会自动识别 IDE 或 AI Agent 并完成配置。

  3. 3. 开始使用技能

    testing 已启用,可立即在当前项目中调用。

! 参考页模式

此页面仍可作为安装与查阅参考,但 Killer-Skills 不再把它视为主要可索引落地页。请优先阅读上方评审结论,再决定是否继续查看上游仓库说明。

Imported Repository Instructions

The section below is supporting source material from the upstream repository. Use the Killer-Skills review above as the primary decision layer.

Supporting Evidence

testing

安装 testing,这是一款面向AI agent workflows and automation的 AI Agent Skill。支持 Claude Code、Cursor、Windsurf,一键安装。

SKILL.md
Readonly
Imported Repository Instructions
The section below is supporting source material from the upstream repository. Use the Killer-Skills review above as the primary decision layer.
Supporting Evidence

LobeHub Testing Guide

Quick Reference

Commands:

bash
1# Run specific test file 2bunx vitest run --silent='passed-only' '[file-path]' 3 4# Database package (client) 5cd packages/database && bunx vitest run --silent='passed-only' '[file]' 6 7# Database package (server) 8cd 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).

Test Categories

CategoryLocationConfig
Webappsrc/**/*.test.ts(x)vitest.config.ts
Packagespackages/*/**/*.test.tspackages/*/vitest.config.ts
Desktopapps/desktop/**/*.test.tsapps/desktop/vitest.config.ts

Core Principles

  1. Prefer vi.spyOn over vi.mock - More targeted, easier to maintain
  2. Tests must pass type check - Run bun run type-check after writing tests
  3. After 1-2 failed fix attempts, stop and ask for help
  4. Test behavior, not implementation details

Basic Test Structure

typescript
1import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; 2 3beforeEach(() => { 4 vi.clearAllMocks(); 5}); 6 7afterEach(() => { 8 vi.restoreAllMocks(); 9}); 10 11describe('ModuleName', () => { 12 describe('functionName', () => { 13 it('should handle normal case', () => { 14 // Arrange → Act → Assert 15 }); 16 }); 17});

Mock Patterns

typescript
1// ✅ Spy on direct dependencies 2vi.spyOn(messageService, 'createMessage').mockResolvedValue('id'); 3 4// ✅ Use vi.stubGlobal for browser APIs 5vi.stubGlobal('Image', mockImage); 6vi.spyOn(URL, 'createObjectURL').mockReturnValue('blob:mock'); 7 8// ❌ Avoid mocking entire modules globally 9vi.mock('@/services/chat'); // Too broad

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

Common Issues

  1. Module pollution: Use vi.resetModules() when tests fail mysteriously
  2. Mock not working: Check setup position and use vi.clearAllMocks() in beforeEach
  3. Test data pollution: Clean database state in beforeEach/afterEach
  4. Async issues: Wrap state changes in act() for React hooks

相关技能

寻找 testing 的替代方案 (Alternative) 或可搭配使用的同类 community Skill?探索以下相关开源技能。

查看全部

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

333.8k
0
AI

widget-generator

Logo of f
f

为prompts.chat的信息反馈系统生成可定制的插件小部件

149.6k
0
AI

flags

Logo of vercel
vercel

React 框架

138.4k
0
浏览器

pr-review

Logo of pytorch
pytorch

Python中具有强大GPU加速的张量和动态神经网络

98.6k
0
开发者工具