# Write Unit Tests

> Create comprehensive unit tests for current code with proper imports/setup per project testing conventions. Use when the user types /write-unit-tests.

- Skill: `blockmatic/write-unit-tests` (Agent Skill)
- Install (CLI): `npx skillmds@latest add blockmatic/write-unit-tests`
- Raw SKILL.md: https://api.skillmd.com/api/skills/blockmatic/write-unit-tests/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: blockmatic (https://skillmd.com/u/blockmatic)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/blockmatic/write-unit-tests

---


## Purpose

Create comprehensive unit tests for current code with proper imports/setup per project testing conventions.

## Steps

1. **Test Coverage**: Test all public methods/functions, cover edge cases/error conditions, test positive/negative scenarios, aim for high coverage
2. **Test Structure**: Use project's testing framework conventions, write clear descriptive test names, follow Arrange-Act-Assert pattern, group related tests logically
3. **Test Cases**: Happy path scenarios, edge cases/boundary conditions, error handling/exception cases, mock external dependencies appropriately
4. **Test Quality**: Make tests independent/isolated, ensure deterministic/repeatable, keep simple/focused, add helpful assertion messages

## Completion

Read [completion evidence](../references/completion.md) before reporting completion.

