aaa-pattern
CommunityEnforce clear tests with AAA (Arrange-Act-Assert)
Authoryanko-belov
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Tests often mix Arrange, Act, and Assert, making failures hard to diagnose and refactors risky. The AAA pattern enforces a clear, repeatable structure that isolates setup, action, and verification.
Core Features & Use Cases
- Clear separation of test phases to improve readability and maintainability.
- Guided refactoring by identifying when actions or assertions are intertwined.
- Cross-framework applicability across popular testing frameworks (e.g., Jest, Mocha, PyTest) to standardize test quality.
- Use Case: When a test contains multiple actions and assertions, convert it into distinct AAA sections to reduce cognitive load and speed debugging.
Quick Start
To start using AAA pattern in your tests, restructure an existing test by placing setup code under Arrange, the operation under Act, and the expected results under Assert, then rename the test to reflect the behavior being verified.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: aaa-pattern Download link: https://github.com/yanko-belov/code-craft/archive/main.zip#aaa-pattern Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.