
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
- 391
- GitHub stars
- 248
- 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 Agents389
- Cloudflare Mcp Server388
- Thesys Generative Ui384
- Access Control Rbac381
- Maz Ui380
- React Best Practices380
- Woocommerce Backend Dev379
- Woocommerce Code Review379
- Bun Hono Integration376
- Bun Test Basics375
- Woocommerce Copy Guidelines374
- Woocommerce Dev Cycle374
- Cloudflare Workers Security369
- Bun Nextjs358
- Bun Package Manager358
- Bun Drizzle Integration353
- Bun Docker343
- Bun Runtime342
- Cloudflare Workers Testing340
- Bun Cloudflare Workers338
- Bun Test Coverage337
- Bun Http Server336
- Bun Test Mocking335
- Nuxt Seo335