goalline How it worksClaude Code hookGitHub ActionBenchmarkCommandsGitHub

goalline / prove-red

Check that new tests fail on the old code

A new test that already passes on the old code doesn't test the change. goalline prove-red runs the tests a change adds against the base code: each one should fail there. Any that pass are flagged.

Why

Test-driven development starts red: a test for a bug should fail before the fix and pass after it. A coding agent asked to fix a bug and add a test can write a test that passes either way, and CI shows two green checks. Nothing proves the new test covers the change.

Run it

npx github:intikhab49/goalline prove-red --base origin/main -- npx jest {files}
npx github:intikhab49/goalline prove-red --base origin/main -- npx vitest run {files}
npx github:intikhab49/goalline prove-red --base origin/main -- python -m pytest {files}

It runs the new tests the change adds (new files, and new tests inside edited files, found by their titles) against the base code in a scratch copy. A new test that passes there does not test the change, and is flagged. It exits 2 when something is flagged (--no-fail to always exit 0), and prints a Markdown summary ready to paste as a pull request comment.

In a pull request

      - uses: intikhab49/goalline@v0
        with:
          check: prove-red
          command: npx jest {files}

Tests that need a database

Each run can get its own database, set up in the scratch copy and dropped afterwards. A setup that fails judges nothing, and the teardown always runs. Only the variable name goes on the receipt, since the URL can hold a password.

goalline prove-red --base origin/main --cwd apps/api \
  --fresh-db 'DATABASE_URL=postgresql://app@localhost:5432/{db}' \
  --setup 'createdb {db} && npx prisma migrate deploy' --teardown 'dropdb {db}' \
  -- npx jest --runInBand {files}

Related