frontend-testing — Claude Code skill: what it does, how to install
Guides frontend testing setups with Jest, Vitest, React Testing Library, and Cypress. Useful for unit tests, Vue components, and end-to-end flows.
npx skills add aj-geddes/useful-ai-prompts --skill frontend-testing -a claude-codeWhat frontend-testing does
This skill provides structured testing patterns for user interfaces. It bundles reference guides for React unit testing in Jest, Vue component tests using Vitest, and end-to-end test suites in Cypress. Another guide covers test coverage reporting.
The included examples show common frontend assertions. They demonstrate button rendering, click handlers with mock functions, and disabled state validation.
Your project still needs the actual testing libraries installed, such as Cypress or @testing-library/react. This skill supplies code conventions, but it does not manage your node_modules dependencies.
What it helps with
- write component tests using React Testing Library
- set up Vitest integration tests for Vue components
- build end-to-end UI scenarios with Cypress
- configure test coverage reporting
Example prompts for the agent
- Write a unit test for this button component using React Testing Library.
- Set up a Cypress end-to-end test for our login form.
- Configure test coverage reporting for this Vitest project.
How to install frontend-testing
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill frontend-testing -a claude-code2Manually: put the files in place
~/.claude/skills/frontend-testing/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/frontend-testing/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill frontend-testing -a codex2Manually: put the files in place
.agents/skills/frontend-testing/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill frontend-testing -a cursor2Manually: put the files in place
.cursor/skills/frontend-testing/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aj-geddes/useful-ai-prompts frontend-testing2Manually: put the files in place
.github/skills/frontend-testing/SKILL.md1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill frontend-testing -a gemini-cli2Platform CLI
gemini skills install https://github.com/aj-geddes/useful-ai-prompts --path skills/frontend-testingManually: put the files in place
.devin/skills/frontend-testing/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill frontend-testing -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about frontend-testing
How to install frontend-testing in Claude Code?
Run npx skills add aj-geddes/useful-ai-prompts --skill frontend-testing -a claude-code. The skill file will be placed in ~/.claude/skills/frontend-testing/SKILL.md.
Which testing frameworks does frontend-testing cover?
It covers Jest, React Testing Library, Vitest for Vue, and Cypress for end-to-end workflows. It also provides reference guides for test coverage configuration.
Does frontend-testing install testing packages automatically?
No. Your project must already have packages like Cypress or @testing-library/react installed. The skill provides code patterns and architectural guides.
Source text
SKILL.md · MIT
---
name: frontend-testing
description: >
Implement comprehensive frontend testing using Jest, Vitest, React Testing
Library, and Cypress. Use when building robust test suites for UI and
integration tests.
---
# Frontend Testing
## Table of Contents
- [Overview](#overview)
- [When to Use](#when-to-use)
- [Quick Start](#quick-start)
- [Reference Guides](#reference-guides)
- [Best Practices](#best-practices)
## Overview
Build comprehensive test suites for frontend applications including unit tests, integration tests, and end-to-end tests with proper coverage and assertions.
## When to Use
- Component testing
- Integration testing
- End-to-end testing
- Regression prevention
- Quality assurance
- Test-driven development
## Quick Start
Minimal working example:
```typescript
// Button.test.tsx
import { render, screen, fireEvent } from '@testing-library/react';
import '@testing-library/jest-dom';
import { Button } from './Button';
describe('Button Component', () => {
it('renders button with text', () => {
render(<Button>Click me</Button>);
expect(screen.getByRole('button')).toHaveTextContent('Click me');
});
it('calls onClick handler when clicked', () => {
const handleClick = jest.fn();
render(<Button onClick={handleClick}>Click</Button>);
fireEvent.click(screen.getByRole('button'));
expect(handleClick).toHaveBeenCalledTimes(1);
});
it('disables button when disabled prop is true', () => {
render(<Button disabled>Click me</Button>);
expect(screen.getByRole('button')).toBeDisabled();
});
it('applies variant styles correctly', () => {
// ... (see reference guides for full implementation)
```
## Reference Guides
Detailed implementations in the `references/` directory:
| Guide | Contents |
|---|---|
| [Jest Unit Testing (React)](references/jest-unit-testing-react.md) | Jest Unit Testing (React) |
| [React Testing Library Integration Tests](references/react-testing-library-integration-tests.md) | React Testing Library Integration Tests |
| [Vitest for Vue Testing](references/vitest-for-vue-testing.md) | Vitest for Vue Testing |
| [Cypress E2E Testing](references/cypress-e2e-testing.md) | Cypress E2E Testing |
| [Test Coverage Configuration](references/test-coverage-configuration.md) | Test Coverage Configuration |
## Best Practices
### ✅ DO
- Follow established patterns and conventions
- Write clean, maintainable code
- Add appropriate documentation
- Test thoroughly before deploying
### ❌ DON'T
- Skip testing or validation
- Ignore error handling
- Hard-code configuration values
© aj-geddes · MIT · aj-geddes/useful-ai-prompts