Home / Prompts / Code

Fix failing tests

Run the test suite, find why tests fail and fix them.

CodeStep by step

The prompt

In ~/code/my-app, run the tests. For each failure, explain the cause in one sentence and propose a fix. Apply the fixes one at a time and rerun the tests after each. Stop and ask me if a fix needs a design decision.

What the AI will do

  1. Runs your test suite.
  2. Explains each failure in one sentence and proposes a fix.
  3. Applies fixes one at a time, reruns the tests after each, and stops to ask you when a fix needs a design decision.

On Windows, Mac and Linux

Same on all three. Your project's test tools must already be installed.

How to use it

  1. Make sure Shellway is connected in ChatGPT, Claude or Cursor.
  2. Paste the prompt and change the folder names or paths to match your computer.
  3. Review the plan your AI shows before you confirm any changes.

Example reply

An illustration of a typical answer. Your AI will show the real files, names and numbers from your computer.

npm test: 3 failing of 112.
1. dates.test.js: timezone assumed UTC; fixed with explicit TZ. Rerun: pass.
2. cart.test.js: rounding 0.1+0.2; fixed with integer cents. Rerun: pass.
3. login.test.js: expects old error text. Change the test or the message? Your call.

Tips

  • Commit your work in git first so you can review every change.

Good to know

Your AI shows its plan before it changes anything, and your rules on the computer still apply: read-only mode, allowed folders and blocked commands, with a backup before each file edit (safety rules). Works in ChatGPT, Claude, Claude Code and Cursor; the free plan gives 50 actions a day (pricing).

Related prompts