Skip to content

Generates Jest unit tests for JavaScript and TypeScript with mocking, async handling, and React component coverage.

CCM score
52 of 100
skills.sh installs
401
GitHub stars
257
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers test generation for JS/TS modules and React components, with source-to-test file naming such as Feature.tsx to Feature.test.tsx
  • Includes Jest patterns for mocks, spies, fake timers, async tests, common matchers, and Testing Library usage
  • Provides a quality checklist that requires all exports to be tested, external dependencies mocked, and coverage of at least 80%
  • Designed for projects using bun test or npm test that need missing coverage added to existing code

Install

$ npx -y skills add secondsky/claude-skills --skill jest-generator -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Jest Generator Skill

Purpose

Generate Jest-based unit tests for JavaScript and TypeScript code, following Jest conventions and best practices with proper mocking, describe blocks, and code organization.

When to Use

  • Generate Jest tests for JavaScript/TypeScript modules
  • Create test files for React components
  • Add missing test coverage to existing code
  • Need Jest-specific patterns (mocks, spies, snapshots)

Test File Naming

Source to Test Mapping:

  • src/components/Feature.tsx → src/components/Feature.test.tsx
  • src/utils/validator.ts → src/utils/validator.test.ts
  • src/models/User.ts → src/models/User.test.ts

Running Tests

# Preferred: Using bun (faster)
bun test

# Run specific file
bun test src/utils/validator.test.ts

# Run with coverage
bun test --coverage

# Watch mode
bun test --watch

# Alternative: Using npm
npm test
npm test -- --coverage

Jest Test Structure

import { functionToTest, ClassToTest } from './Feature'

jest.mock('./dependency')

describe('ModuleName', () => {
  beforeEach(() => {
    jest.clearAllMocks()
  })

  afterEach(() => {
    jest.restoreAllMocks()
  })

Details

Repository
github.com/secondsky/claude-skills
Categories
Testing & QA, Frontend & UI Code
First seen
Jun 3, 2026

Questions

What does the jest-generator skill do?

The jest-generator skill writes Jest unit tests for JavaScript and TypeScript code, including React components. It applies Jest conventions with proper mocking, describe blocks, spies, snapshots and async and timer tests.

How do I install the jest-generator skill?

Run npx -y skills add secondsky/claude-skills --skill jest-generator -y in your project to install the jest-generator skill. Once installed, jest-generator lets your agent generate Jest tests for your modules and components.

Which testing category does jest-generator belong to?

The jest-generator skill sits in the Testing & QA category on Claude Marketplaces. Its sibling skills there include tdd, migrate-to-shoehorn, test-driven-development, webapp-testing and break-ui.

Can jest-generator help with missing test coverage?

Yes, the jest-generator skill adds missing test coverage to existing JavaScript and TypeScript code. It names test files after their source modules and aims for at least 80% coverage with happy path, edge case and error tests.

More from secondsky/claude-skills

All 116

Similar to Jest Generator

More Testing & QA