
Jest Generator
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
- 395
- GitHub stars
- 250
- last updated
- Aug 21, 2026
Install
$ npx -y skills add secondsky/claude-skills --skill jest-generator --agent claude-codeInstalls 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.tsxsrc/utils/validator.ts→src/utils/validator.test.tssrc/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- Cloudflare Agents393
- Cloudflare Mcp Server392
- Thesys Generative Ui387
- React Best Practices385
- Maz Ui384
- Woocommerce Code Review383
- Woocommerce Backend Dev382
- Access Control Rbac381
- Bun Test Basics380
- Cloudflare Workers Security380
- Bun Hono Integration379
- Woocommerce Copy Guidelines378
- Woocommerce Dev Cycle378
- Bun Nextjs362
- Bun Package Manager361
- Bun Drizzle Integration356
- Bun Docker347
- Bun Runtime345
- Cloudflare Workers Testing344
- Bun Cloudflare Workers342
- Bun Test Coverage341
- Bun Http Server339
- Bun Test Mocking339
- Nuxt Seo339