Refactor tests to remove duplication
Refactor a duplicated test file with shared fixtures, parameterized cases, and helpers. Reduces repetition without sacrificing test name clarity.
Preview
Copy prompt
The following test file has grown unwieldy with significant repetition across test cases: [Paste test code]. Refactor it by extracting shared setup into fixtures or before-each hooks, converting groups of nearly identical tests into parameterised or data-driven test cases, and creating helper functions for assertion patterns used in multiple places. Ensure every test retains a descriptive name that clearly communicates what specific scenario it is validating.
More
Testing
Prompts
