MCP.so
Sign In
Testingevent

Post-Edit Test Guard

Hook-based loop that runs related tests after file edits to catch regressions early.

Kickoff prompt

Install and run the "Post-Edit Test Guard" loop.

Goal: after each batch of file edits, related tests must pass before continuing.
Between iterations run: npm test -- --findRelatedTests <edited files>
Exit when: related tests exit 0.

Step 1: After edits, run related tests. If they fail, fix before making more changes.

Basic information

Category

Testing

Goal

after each batch of file edits, related tests must pass before continuing.

Check command

npm test -- --findRelatedTests <edited files>

Exit when

related tests exit 0.

Supported agents

Cursor

Steps

  1. 1

    Detect edited files

    Identify which source files were edited in the last turn.

  2. 2

    Run related tests

    Run the smallest relevant test subset for edited files. Fix failures before continuing.

    npm test -- --findRelatedTests

More Testing loops