update-test

Update failing test suites after intentional contract changes by correcting assertions, fixtures, and golden files.

Updated Dec 21, 2018
One-click install
npx skills add https://github.com/dhnt/dhnt --skill update-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: update-test
Source: https://github.com/dhnt/dhnt/tree/main/catalog/md/test/update-test
Command: npx skills add https://github.com/dhnt/dhnt --skill update-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Update-test helps teams repair test suites that fail after an intentional change to the code’s public contract, ensuring tests continue to validate the new expected behavior rather than being blindly loosened or removed.

Core Features & Use Cases

  • Contract-change test alignment: Update assertions, fixtures, and golden files so tests reflect the new function/field/error shapes.
  • Meaning-preserving test maintenance: Decide whether each affected test remains valuable, should be deleted cleanly, or consolidated with another test.
  • Regression coverage for new edge cases: Add at least one new test covering any new validation or error behavior introduced by the contract change.
  • Use case: A renamed return field or changed error type breaks existing tests after a planned refactor; update-test guides you to systematically migrate expectations and keep coverage meaningful.

Quick Start

Tell the AI to update the repository’s failing tests to match the newly intended contract change by identifying every affected assertion, updating or deleting tests as appropriate, adding new coverage for the newly introduced edge cases, and then running the full test suite plus the linter.

Frequently Asked Questions about update-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I update failing unit tests after an intentional API contract change?

To update failing unit tests after an intentional API contract change, you must systematically correct affected assertions, fixtures, and golden files. This ensures the test suite validates the newly expected behavior instead of being blindly loosened or deleted.

When should I update golden files during a test suite maintenance workflow?

Golden files should be updated during test suite maintenance when a deliberate refactor or API modification intentionally changes return shapes. You must confirm the intended contract first, then locate and correct impacted golden files to match the new output expectations.

What is the best way to handle stale tests caused by renamed return fields or changed error types?

The best way to handle stale tests caused by renamed return fields or changed error types is to evaluate each impacted test. You can update assertions to preserve meaningful coverage, consolidate overlapping tests, or cleanly delete obsolete ones.

How do I add regression coverage for new edge cases introduced by a contract change?

To add regression coverage for new edge cases introduced by a contract change, identify any new validation or error behavior resulting from the modification. Then, implement at least one new test specifically targeting those newly introduced behaviors.

Does updating tests for contract changes require running the full test suite and linter?

Yes, updating tests for contract changes requires running the full test suite and linter. Executing the complete suite and linter verifies that all affected assertions, fixtures, and golden files align with the intended contract without introducing syntax errors.

Can I use automated test maintenance to prevent loosening meaningful assertions during a refactor?

Automated test maintenance during a refactor can prevent loosening meaningful assertions by requiring confirmation of the intended contract. It systematically locates impacted tests and preserves valuable assertions while correcting affected fixtures and golden files.