mcpField
F
frontend-testing

frontend-testing

github.com/aj-geddesTesting & quality373510 installsUpdated 34w ago
Repository

About frontend-testing

A testing skill for frontend developers building unit, integration, and end-to-end test suites. Its guides cover React, Vue, and several testing tools.

Key features

  1. 01Write unit tests
  2. 02Write integration tests
  3. 03Write end-to-end tests
  4. 04Guides for React, Vue, Jest, Vitest, and Cypress
  5. 05Configure test coverage

Use cases

  1. 01Test frontend components
  2. 02Verify integration between components
  3. 03Run end-to-end regression tests
  4. 04Check test coverage before deployment

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill frontend-testing

After installing, type/frontend-testingin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
cypress-e2e-testing.md
jest-unit-testing-react.md
react-testing-library-integration-tests.md
test-coverage-configuration.md
vitest-for-vue-testing.md
scripts/
scaffold-tests.sh
templates/
test-template.js

Details

From the project README

Frontend Testing

Table of Contents

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:

// 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:

GuideContents
Jest Unit Testing (React)Jest Unit Testing (React)
React Testing Library Integration TestsReact Testing Library Integration Tests
Vitest for Vue TestingVitest for Vue Testing
Cypress E2E TestingCypress E2E Testing
Test Coverage ConfigurationTest 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

Comments

Markdown supported