Testing
The Unsexy Stack ships with 200 tests — 145 backend (pytest) and 55 frontend (Vitest) — at 98% backend coverage. These are the counts in the shipped download, published in full, not cherry-picked screenshots.
A real-Postgres integration lane
Section titled “A real-Postgres integration lane”Many boilerplates test against SQLite for speed, which silently hides transaction-lifecycle and constraint bugs that only appear on a real database. The backend suite includes an integration lane that runs against real PostgreSQL, so the race-safe provisioning and webhook idempotency tests exercise the same engine you ship on.
The tests prove the hard parts
Section titled “The tests prove the hard parts”The hard parts are each backed by a test in the download:
- Race-safe provisioning — two concurrent first-logins both miss the row, both insert; the
loser catches the
IntegrityErrorand re-fetches.test_deps_get_db_user.pyasserts no duplicate user. - JWKS cache —
test_auth_cache.pyasserts the cache serves from memory within the TTL and refetches after expiry. - Webhook replay —
test_edge_cases.pyposts a re-delivered Stripeevent_idand assertsalready_processed, never a double-charge.
Running them
Section titled “Running them”make test # backend + frontend, with coveragecd backend && pytest --collect-only -q | tail -1 # confirm the count yourselfThe point of publishing the counts and the integration lane is simple: you can verify the quality before you build on it.