Testing & QA Code Reorder Medium +20 XP
AAA Pattern
Arrange the Arrange-Act-Assert test pattern.
Click lines in the correct order
Available lines3 left
Your order
Click lines above to build your solution.
Show answer and explanation
Answer: const add = (a, b) => a + b;
const result = add(2, 3);
expect(result).toBe(5);
Arrange (set up), Act (execute), Assert (verify). This is the standard test structure.
Hint: Set up before acting, assert after.
What this challenge tests
Code Reorder in Testing & QA: aaa-pattern, best-practices.