From 49aefdd973e083537dd0b0d91845cdcb1bb91fdd Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Mon, 2 Mar 2026 17:07:38 +0000 Subject: [PATCH] chore: update test directions in AGENTS.md (#22490) Our `AGENTS.md` previously contained this directive: > When adding tests for new behavior, add new test cases instead of modifying existing ones. This preserves coverage for the original behavior and makes it clear what the new test covers. This leads to inflated diffs and test explosions. Updating it to bias more towards updating existing tests where applicable. --------- Co-authored-by: Danielle Maywood Co-authored-by: Mathias Fredriksson --- AGENTS.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 9cdb31a125..f40a4e5f3c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -198,9 +198,7 @@ reviewer time and clutters the diff. **Don't delete existing comments** that explain non-obvious behavior. These comments preserve important context about why code works a certain way. -**When adding tests for new behavior**, add new test cases instead of modifying -existing ones. This preserves coverage for the original behavior and makes it -clear what the new test covers. +**When adding tests for new behavior**, read existing tests first to understand what's covered. Add new cases for uncovered behavior. Edit existing tests as needed, but don't change what they verify. ## Detailed Development Guides