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
- How it works: old tests on new code, the verdicts, and what it can't catch
- Claude Code hook: a Stop hook that won't let the agent finish until it explains a moved test
- GitHub Action: one step in a workflow, with Jest, Vitest or pytest
- Skip what passed: signed receipts keyed by the git tree, and safe reuse
- Database inputs: the database schema on the receipt, with --input db=pg
- The clock: which tests read the real clock, and passes that expire
- Benchmark: 31 flags on 400 merged PRs, each with its PR's reason
- Commands: every command and option