# Af Write Jest Tests

> Write Jest unit tests for pure functions, validation logic, and business rules. Use when creating test files, debugging failing unit tests, or improving test coverage for non-UI code.

- Skill: `majiayu000/af-write-jest-tests` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/af-write-jest-tests`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/af-write-jest-tests/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/af-write-jest-tests

---


# Jest Unit Tests

## What to read

**TDD workflow (Red → Green → Refactor):**
→ [testing-guide.md#tdd-workflow](../../docs/guides/testing-guide.md#tdd-workflow)

**Jest setup, test structure, mocking, and fixtures:**
→ [testing-guide.md#unit-testing-with-jest](../../docs/guides/testing-guide.md#unit-testing-with-jest)

**Test best practices (naming, AAA pattern, independence):**
→ [testing-guide.md#best-practices](../../docs/guides/testing-guide.md#best-practices)

**Running tests and CI/CD integration:**
→ [testing-guide.md#running-tests](../../docs/guides/testing-guide.md#running-tests)

**For comprehensive testing rules and pitfalls:**
→ [af-configure-test-frameworks/SKILL.md](../af-configure-test-frameworks/SKILL.md)

