ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

snapshot-test

Generate Jest snapshot tests for components

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/lxgicstudios/ai-snapshot-test
Or

Snapshot Test Generator

Point it at your components, get snapshot tests. Covers common states and props.

Quick Start

npx ai-snapshot-test ./src/components/Button.tsx

What It Does

  • Generates Jest snapshot tests
  • Covers default and edge cases
  • Tests different prop combinations
  • Handles async components

Usage Examples

# Generate for a component
npx ai-snapshot-test ./src/components/Card.tsx

# Generate for directory
npx ai-snapshot-test ./src/components/

# With specific test runner
npx ai-snapshot-test ./components --runner vitest

Output Example

describe('Button', () => {
  it('renders default state', () => {
    const { container } = render(<Button>Click me</Button>);
    expect(container).toMatchSnapshot();
  });

  it('renders disabled state', () => {
    const { container } = render(<Button disabled>Click me</Button>);
    expect(container).toMatchSnapshot();
  });
});

Test Cases Generated

  • Default props
  • Required prop variations
  • Edge cases (empty, null)
  • Loading/error states
  • Different sizes/variants

Requirements

Node.js 18+. OPENAI_API_KEY required.

License

MIT. Free forever.


Built by LXGIC Studios

Metadata

Stars1601
Views1
Updated2026-02-27
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-lxgicstudios-ai-snapshot-test": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.