Generates Jest unit tests for JavaScript and TypeScript code with proper mocking, describe blocks, and coverage patterns. You get test files that follow the standard naming convention (Feature.test.tsx), include beforeEach/afterEach hooks for cleanup, and handle async testing, timers, and React components with Testing Library. The skill covers both bun and npm test runners, which is helpful since bun is faster but not everywhere yet. The structure templates are solid, especially the Arrange/Act/Assert pattern and the common matchers reference. Honestly, this is most useful when you need to backfill tests on existing code or want consistent test structure across a codebase without remembering every Jest API detail.

skills.sh installs
391
GitHub stars
248
last updated
Aug 21, 2026

Install

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

Installs into .claude/skills of the current project.

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()
  })

Sponsors

Details

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

More from secondsky/claude-skills

All 146
1community-access avatarmobile-accessibilitycommunity-access/accessibility-agentsMobile accessibility specialist for React Native, Expo, iOS (SwiftUI/UIKit), and Android (Jetpack Compose/Views). Audits accessibilityLabel, accessibilityRole, 384skills.sh installs
2hairyf avataruniapphairyf/skillsuni-app 跨平台应用开发框架。适用于使用 Vue 语法开发 App、H5、各端小程序时的能力与用法。381skills.sh installs
3maxnorm avatarmagento-xml-specialistmaxnorm/magento2-agent-skillsCreates XML configurations for Magento 2 including layout XML, dependency injection, system configuration, and module definition. Use when working with XML conf380skills.sh installs
4galaxy-dawn avatarwebapp-testinggalaxy-dawn/claude-scholarToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing br375skills.sh installs
5davila7 avatarwebapp-testingdavila7/claude-code-templatesToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing br370skills.sh installs
6zzci avatarpma-crzzci/skillsCode review: stack-aware review for local diffs, pull requests, and repository-wide audits. Routes review across shared policy plus language packs for TypeScrip368skills.sh installs