snapshot-test
Generate Jest snapshot tests for components
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/lxgicstudios/ai-snapshot-testSnapshot 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
- GitHub: github.com/lxgicstudios/ai-snapshot-test
- Twitter: @lxgicstudios
Metadata
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 skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-lxgicstudios-ai-snapshot-test": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
script-gen
Generate package.json scripts with AI. Use when setting up npm scripts.
email-template-gen
Generate responsive email templates. Use when building transactional emails.
branch-namer
Generate descriptive git branch names from plain English. Use when you need a branch name that follows conventions.
cloudflare-gen
Generate Cloudflare Workers configuration and code. Use when building on the edge.
adr-writer
Generate Architecture Decision Records with AI. Use when documenting technical decisions.