Add tests so changes stop breaking your app: a Claude + Cursor + GitHub Copilot stack

The struggle: Every change to your AI-built app breaks something old and you only find out from users.

What you end up with: A small set of automatic tests for your three most important flows, run before every change.

Choose the flows that must never break, ask Cursor to write tests for only those, run them, and use a Copilot review on the test code. A test that passes only matters if you have seen it fail.

Tools: Claude, Cursor, GitHub Copilot. Level: Free to start. Time: 3 hours.

Use it if

  • Every change breaks something old
  • You find out from users
  • You have a repo but no tests

Skip it if

  • You cannot run the project on your computer yet
  • You need full coverage: start with the key three

The method

  1. Choose what to protect (Claude: Chat)

    List your app's features and ask Claude to pick the three flows that cost most when broken, with a plain checklist for each.

    Prompt to copy:

    Here are my app's features: [list]. Pick the 3 flows that would hurt users most if broken (such as sign up, pay, save). For each give a one-line description, the steps a user takes, and the result that proves it works. Ask me which flows matter most if unclear.

    You get: Three flows with pass conditions.

    Tip: Protect money and login first.

  2. Plan the tests (Cursor: Plan Mode)

    Press Shift+Tab to start Plan Mode and ask Cursor to look at how the project is built and plan tests for those three flows with the testing tool already in the project or the simplest standard one.

    Prompt to copy:

    Plan tests for these three flows: [paste]. First check which test tool the project already uses, and if none, propose the simplest standard one. List the files you will add, the commands to run the tests, and what the test will check. Do not change existing app code. Ask me before installing anything.

    You get: A test plan for three flows.

    Tip: Ask for tests only. If it edits app code, stop.

  3. Write and run the tests (Cursor: Agent)

    Approve the plan and let the Agent write the tests, then run the test command it gave you. Watch the output.

    You get: Passing tests, or a clear failure.

    Tip: If it needs to change app code to pass, read the change before accepting.

  4. Prove each test can fail (Cursor: Agent)

    Break each flow on purpose, for example rename a button or change a price, run the tests and confirm they fail. Then undo the break.

    Prompt to copy:

    For each of the three tests, show me one small, safe change to the app that should make it fail, and how to undo it. I will make it, run the tests and undo it. Do not apply any change yourself.

    You get: Tests that you have seen fail.

    Tip: A test that cannot fail is only a comfort.

  5. Get the test code reviewed (GitHub Copilot: Review selection)

    In VS Code select the new test file and use Review selection. Ask for weak checks, missing cases and tests that always pass. Run the suite again before every change.

    You get: A review of the tests.

    Tip: Run tests before every change, not only at the end.

Where this goes wrong

  • This needs basic comfort with code. Ask a developer if the commands feel unclear.
  • Do not let the assistant weaken a test to make it pass.
  • Check Cursor's privacy settings and your Copilot plan's data-use settings, and ask your plan admin if you are unsure.

Swap a tool

  • Replit instead of Cursor: Replit Agent can also write and run tests inside the project.

Sources

More like this

Updated . Written with AI help and checked by an independent review step, as described in our editorial standards.