In plain words
A test is a small piece of code that runs part of your app and checks the result, so you learn when a change breaks something.
Where you see it
You ask the agent to fix QuickBite's discount codes and, without mentioning it, it changes how delivery is added. A test that expects 2 pizzas at 9.50 plus 3.00 delivery to cost 22.00 turns red, and you know before your customers do.
What goes wrong
- Letting the agent edit the test until it passes
When a test fails, the agent may change what the test expects instead of fixing the code. In the diff, a changed expected value deserves a question.
- Tests that check nothing
toBeDefined() passes for the wrong total too. Check the actual value you care about.
expect(orderTotal(items, 3)).toBeDefined(); - Tests nobody runs
Tests only help if they run on every change. Ask the agent to run them before it says it's done, or set them to run on every push.
What to tell your agent
Quick check
Sign in to earn +10 XP for itA test fails after the agent's change. The agent edits the test's expected value and now everything passes. What next?