generate-tests
БесплатноБез исполняемых скриптовНе проверенGenerate comprehensive unit tests for a Spark UI component using Vitest and React Testing Library. Use when the user wants to add tests, improve test…
от leboncoin★ 94 звезды на GitHubОб этом скилле
Generate Tests
Create or update unit tests for Spark UI components following the project's testing standards.
When to Use
- User wants to add tests to a component
- User mentions "test", "testing", or "test coverage"
- Component is missing tests or has incomplete test coverage
Instructions
Test File Location: Tests go in
ComponentName.test.tsxin the component directoryTesting Library Setup:
- Use Vitest as the test runner
- Use React Testing Library for rendering and queries
- Use
@testing-library/user-eventfor interactions
Test Structure:
import { describe, it, expect } from 'vitest' import { render, screen } from '@testing-library/react' import userEvent from '@testing-library/user-event' import { ComponentName } from './ComponentName' describe('ComponentName', () => { it('should render', () => { render(<ComponentName {...defaultProps} />) expect(screen.getByRole('...')).toBeInTheDocument() }) it('should be accessible', () => { // Accessibility tests }) })What to Test:
- Component renders correctly
- All props work as expected
- All variants (size, variant, etc.) render correctly
- User interactions (clicks, keyboard, etc.)
- Accessibility features (ARIA attributes, roles, etc.)
- Edge cases and error states
Accessibility Testing:
- Verify proper ARIA attributes
- Test keyboard navigation
- Verify focus management
- Check semantic HTML
Run Tests:
- Use
npm run test:uifor watch mode - Use
npm run test:runfor single run - Use
npm run test:coveragefor coverage report
- Use
Examples
Reference existing test files in packages/components/src/*/ComponentName.test.tsx for patterns.
Установить generate-tests в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл generate-tests?
Generate comprehensive unit tests for a Spark UI component using Vitest and React Testing Library. Use when the user wants to add tests, improve test coverage, or test a specific component.
Как установить скилл generate-tests?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл generate-tests запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic