Skip to content
Hidden Logic Lab

Move the tests without changing the behavior

Ask Cursor to port a test file to the repo's current runner while the assertions stay the same.

·Coding·25 min·Working

A ported test file and a note of any assertion that could not move unchanged.

  1. 1

    Point at a neighbor

    Name one existing test file whose style the port should match, so Cursor does not invent a third style.

  2. 2

    Run the file

    Run the command it gives you. A port that does not execute is unfinished.

  3. 3

    Diff the assertions

    Compare old and new assertions. Behavior changes do not belong in a port.

The prompt to paste

Port the tests in [file] to the test style already used in this repository. Match the imports, the runner, and the file layout of a neighboring test.

Rules:
- Keep every assertion. If one cannot move, stop and list it.
- Do not change production code.
- Do not add cases that were not in the original file.
- Show me the command to run just this file.

When you finish, summarize what moved and what you refused to change.

Green tests can hide a weaker assertion. Read the expects.

Sample case written by Hidden Logic Lab. Not affiliated with Cursor.

More in Coding

Get new cases in your inbox

Weekly notes on new use cases and agent workflows. No product pitches.

Occasional notes on new cases. No product pitches in the first note.