@rulepack/test-first

v0.1.3

Test-first conventions: test names are sentences, no mocks for code we own, real DB in integration tests.

Updated 6/4/20265 files | 4.1 KB
$pnpm dlx rulepack add test-first

Drops CLAUDE.md / .cursor/rules/* and friends into your project.

Downloads

0

Stars

0

Views

0

test-first

Test-first conventions: test names are sentences, no mocks for code we own, real DB in integration tests.

npx rulepack add test-first

What it covers

  • Test-first workflow: reproduce a regression with a failing test first; for new features start from the smallest end-to-end test and iterate inward
  • A three-layer test pyramid — fast unit tests (no I/O), integration tests for the seam between your code and external systems, and a few end-to-end tests against the real stack
  • Behaviour-focused test names (it("rejects expired tokens"), not it("calls verifyJwt")) with one assertion per behaviour
  • No mocking code you own and no mocking the database — use a real test DB with transactional rollback per test
  • Snapshots only for stable, semantic outputs (never deep JSON with timestamps/IDs), always reviewed in PR; coverage treated as a smell detector, not a target

Based on

Established test-first / TDD practice — tests as executable specifications, real collaborators over mocks, integration tests against real infrastructure.

License

MIT