Token导航 LogoToken导航TokenDH.com
开发操作浏览器unknown未标认证来源可访问许可证需确认审计未展示

testing测试

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

1,374

周安装

59

下载量

481
Local Agent

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:testing(测试)
来源仓库:https://smithery.ai
仓库路径:testing
安装命令:
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。当前暂无明确安装命令,请以来源页面说明为准。

简介

testing 用于辅助测试设计、自动化测试、用例整理和回归验证,适合在 Local Agent 中扩展测试能力时使用。

  • 可支持多种测试框架下的用例编写与执行建议。
  • 适用于新功能上线前的质量校验环节。testing 属于开发类 Skill,可作为该场景下的辅助能力补充。
  • 使用前需明确测试环境与生产环境的隔离情况。
  • 注意不要因追求通过率而引入虚假断言。

SKILL.md

Testing Skill

This skill defines the testing standards for the Slotify booking application.

Testing Stack

  • Vitest - Test runner and assertion library
  • React Testing Library - Component testing
  • jsdom - Browser environment simulation

Test File Organization

src/
├── lib/
│   ├── availability.ts
│   └── availability.test.ts      # Unit tests next to source
├── components/
│   ├── BookingFlow.tsx
│   └── BookingFlow.test.tsx
└── __tests__/                    # Integration tests
    └── booking-flow.test.ts

Running Tests

# Run all tests
npm run test

# Run with coverage
npm run test:coverage

# Run specific file
npm run test -- availability.test.ts

# Watch mode
npm run test -- --watch

Testing Patterns

1. Unit Tests for Business Logic

Test pure functions and business logic thoroughly:

import { describe, it, expect } from 'vitest';
import { generateTimeSlots, isSlotAvailable } from './availability';

describe('Availability Engine', () => {
  describe('generateTimeSlots', () => {
    it('should generate 15-minute slots within business hours', () => {
      const slots = generateTimeSlots({
        startTime: '09:00',
        endTime: '17:00',
        slotDurationMinutes: 15,
      });

      expect(slots).toHaveLength(32);
      expect(slots[0]).toBe('09:00');
      expect(slots[slots.length - 1]).toBe('16:45');
    });

    it('should respect buffer times', () => {
      // ... test buffer time logic
    });
  });
});

2. Component Tests

Test component behavior, not implementation:

import { render, screen, fireEvent, waitFor } from '@testing-library/react';
import { describe, it, expect, vi } from 'vitest';
import { BookingForm } from './BookingForm';

describe('BookingForm', () => {
  it('should submit booking with valid data', async () => {
    const onSubmit = vi.fn();

    render(<BookingForm onSubmit={onSubmit} />);

    // Fill form
    fireEvent.change(screen.getByLabelText(/name/i), {
      target: { value: 'John Doe' },
    });
    fireEvent.change(screen.getByLabelText(/email/i), {
      target: { value: 'john@example.com' },
    });

    // Submit
    fireEvent.click(screen.getByRole('button', { name: /book/i }));

    await waitFor(() => {
      expect(onSubmit).toHaveBeenCalledWith({
        name: 'John Doe',
        email: 'john@example.com',
      });
    });
  });

  it('should show validation errors for invalid email', async () => {
    render(<BookingForm onSubmit={vi.fn()} />);

    fireEvent.change(screen.getByLabelText(/email/i), {
      target: { value: 'invalid-email' },
    });
    fireEvent.click(screen.getByRole('button', { name: /book/i }));

    expect(await screen.findByText(/invalid email/i)).toBeInTheDocument();
  });
});

3. Server Action Tests

Mock Supabase for server action tests:

import { describe, it, expect, vi, beforeEach } from 'vitest';
import { createBooking } from './actions';

vi.mock('@/utils/supabase/server', () => ({
  createClient: vi.fn(() => ({
    from: vi.fn(() => ({
      insert: vi.fn(() => ({
        select: vi.fn(() => ({
          single: vi.fn(() => ({ data: mockBooking, error: null })),
        })),
      })),
    })),
  })),
}));

describe('createBooking', () => {
  it('should create booking and return success', async () => {
    const formData = new FormData();
    formData.set('service_id', '123');
    formData.set('client_name', 'Test Client');

    const result = await createBooking(formData);

    expect(result.success).toBe(true);
    expect(result.booking).toBeDefined();
  });
});

What to Test

Must Test (Critical Paths)

  • Availability calculation logic
  • Booking creation/cancellation
  • Double-booking prevention
  • Token validation
  • Timezone conversions

Should Test

  • Form validation
  • Component interactions
  • Error states
  • Loading states

Nice to Have

  • Edge cases
  • Visual regression (with Playwright)
  • E2E booking flow

Test Coverage Targets

CategoryTarget
Business logic (lib/)90%+
Server actions80%+
Components70%+
Overall75%+

Mocking Guidelines

  1. Mock external services (Supabase, Resend) not internal modules
  2. Use real implementations when possible for integration tests
  3. Reset mocks in beforeEach to avoid test pollution
  4. Avoid over-mocking - it leads to false positives

Common Pitfalls

  • ❌ Testing implementation details instead of behavior
  • ❌ Not waiting for async operations
  • ❌ Forgetting to cleanup after tests
  • ❌ Using toMatchSnapshot() without purpose
  • ✅ Testing user interactions and outcomes
  • ✅ Using waitFor and findBy* for async content

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Local Agent

94.15%
按下载量换算453

安全审计

暂无安全审计结果可展示。

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills