neuralmind.uk / Use Case: Find the Coverage That Lies — Endpoints Tested Only in Mock Mode Edit this page on GitHub ↗

Use Case: Find the Coverage That Lies — Endpoints Tested Only in Mock Mode

What you’re solving for

Your test suite is green. But an endpoint can pass every test in mock mode — an in-memory store that happily accepts any string where Postgres would reject a non-UUID foreign key — and still throw the moment it hits a real database. That’s the P2003 shape: three passing tests, all SKIP_PG-guarded, zero live coverage, one production failure. “All tests pass” told you nothing about the path that actually breaks.

neuralmind gaps cross-references the routes your app registers against the tests that exercise them, and tells you which endpoints are actually covered against a live database versus which are only pretending.

Setup (one time)

pip install neuralmind

No index build required — gaps reads your source and test files directly.

Run it

cd your-project
neuralmind gaps
## neuralmind gaps — live-Postgres coverage

Routes tested in-memory only (no live-DB coverage):
  POST /api/sessions            — 3 tests — all SKIP_PG  ❌
  GET  /.well-known/jwks.json   — 1 test — all SKIP_PG   ❌
Endpoints with no tests:
  POST /api/auth/jwk/rotate     ⚠️
Live-covered:
  GET  /health                  ✅

Read it top to bottom:

How it decides

Phase 1 covers Express + Jest (JS/TS):

Wire it into CI

Run it as a gate so a new mock-only endpoint fails the build instead of shipping:

neuralmind gaps | tee gaps.txt
grep -q "❌" gaps.txt && echo "::warning::endpoints lack live-DB coverage"

Honest scope

Phase 1 is Express/Jest heuristics (regex over JS/TS), not a full parser — it does not cover other frameworks yet, and route matching is best-effort on unusual path construction. It surfaces suspects to verify, not a proof of coverage.